cortlepp opened a new pull request, #15843: URL: https://github.com/apache/lucene/pull/15843
The current implementation of `PosixNativeAccess` always tries to use native access, even if this is disallowed by the JVM. This can lead to warnings on JDK24+ and will eventually be the default setting in future JVM versions. Additionally the current singleton implementation in `PosixNativeAccess` is problematic because it does the native setup during class initialization (`<clinit>`). This makes the timing of that setup unpredictable (because the JVM may load classes at any time, not just before first use) and can cause the entire application to fail if an exception is thrown (and not caught) during this setup (even if the application would work fine without native access). This PR: - changes the implementation to only attempt enabling native access if this is allowed by the running JVM - changes the singleton in `PosixNativeAccess` to use an enum pattern -- 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]
