You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by "uschindler (via GitHub)" <gi...@apache.org> on 2023/07/03 15:42:40 UTC

[GitHub] [lucene] uschindler commented on a diff in pull request #12412: DRAFT: This vectorize ForUtil for the 9.0 codec (same format)

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