You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by "reta (via GitHub)" <gi...@apache.org> on 2023/05/18 18:59:48 UTC

[GitHub] [lucene] reta commented on a diff in pull request #12308: Wrap Query rewrite backwards layer with AccessController

reta commented on code in PR #12308:
URL: https://github.com/apache/lucene/pull/12308#discussion_r1198196299


##########
lucene/core/src/java/org/apache/lucene/search/Query.java:
##########
@@ -50,8 +52,30 @@ public abstract class Query {
       new VirtualMethod<>(Query.class, "rewrite", IndexReader.class);
   private static final VirtualMethod<Query> newMethod =
       new VirtualMethod<>(Query.class, "rewrite", IndexSearcher.class);
-  private final boolean isDeprecatedRewriteMethodOverridden =
-      VirtualMethod.compareImplementationDistance(this.getClass(), oldMethod, newMethod) > 0;
+  private final boolean isDeprecatedRewriteMethodOverridden;
+
+  /** Constructor for query classes. */
+  public Query() {
+    var clazz = this.getClass();
+    if (clazz.getName().startsWith("org.apache.lucene.")) {

Review Comment:
   Just to note here, both OpenSearch [1] and Elasticsearch [2] host own classes under `org.apache.lucene.` package as well:
   
   [1] https://github.com/opensearch-project/OpenSearch/tree/main/server/src/main/java/org/apache/lucene
   [2] https://github.com/elastic/elasticsearch/tree/7.17/server/src/main/java/org/apache/lucene



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org