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


##########
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:
   That's an argument to not do this optimization. I also tend to revert my 
last commit.
   
   I was just thinking about a solution that does not need the extra permission.



-- 
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-unsubscr...@lucene.apache.org

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


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

Reply via email to