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


##########
lucene/core/src/java/org/apache/lucene/internal/vectorization/VectorizationProvider.java:
##########
@@ -162,11 +165,8 @@ private static boolean isClientVM() {
     }
   }
 
-  private static boolean isValidCaller(String cn) {
-    // add any class that is allowed to call getInstance()
-    // NOTE: the list here is lazy
-    return 
Stream.of(VectorUtil.class).map(Class::getName).anyMatch(cn::equals);
-  }
+  private static final Set<String> VALID_CALLERS =
+      Set.of("org.apache.lucene.util.VectorUtil", 
"org.apache.lucene.codecs.lucene90.PForUtil");

Review Comment:
   This is the bug I found in my last PR: You can't refer to package private 
classes with `.class` operator. So I had to hardcode the full class names here.
   
   Maven Shaders will replace those names, so I see no problem with making them 
strings.



-- 
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