uschindler commented on PR #12410:
URL: https://github.com/apache/lucene/pull/12410#issuecomment-1618743022

   I figured out that the caller sensitive checking how it wa simplemented does 
not work with package private classes, so I plan to fix this in a followup 
commit:
   
   ```java
     private static final Set<String> VALID_CALLERS =
         Set.of("org.apache.lucene.util.VectorUtil", 
"org.apache.lucene.codecs.lucene90.PForUtil");
   
     private static void ensureCaller() {
       final boolean validCaller =
           StackWalker.getInstance()
               .walk(
                   s ->
                       s.skip(2)
                           .limit(1)
                           .map(StackFrame::getClassName)
                           .allMatch(VALID_CALLERS::contains));
       if (!validCaller) {
         throw new UnsupportedOperationException(
             "VectorizationProvider is internal and can only be used by known 
Lucene classes.");
       }
     }
   ```


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