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

   Hi,
   the warning isse is the same if you don't enable vectorization preview. 
Lucene is written to actually "require" thos parts, but it works slower 
without. So we prefer to log a warning. If e.g., in Java 27, the JVM disables 
native access by default, we would like to avoid
   
   Actually the current code is a bit broken due to this change by @jpountz: 
https://github.com/cortlepp/lucene/commit/3003731aa94225b3a07cb9fb667fc8fd62bb2d10
   
   The first two lines of the static initializer must be inside the 
try...catch. The code is NOT briddle, sorry. The exception handling was done 
carefully and accoridng to the native access spec. We don't generally want to 
do anything like "catch (RuntimeException _)", because it would swallow an 
important exception. If the static initializer breaks, its a bug in the JVM and 
should fail.
   
   So IMHO, the change by @jpountz should be fixed to move the first two lines 
of the static initializer to the try/catch block. This is indeed a bug and may 
fail the startup - the UnsupportedOperationException is handled there.
   
   I can open a PR and merge this to fix this bug, but all the other code 
changes here are unneeded and theres no risk in the current code because all 
native access runtime Exceptions are handled according to the Panama Foreign 
spec.


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to