Fokko opened a new pull request, #3904: URL: https://github.com/apache/parquet-java/pull/3904
### Rationale for this change On JDK 9+ `Unsafe.invokeCleaner` is always present, so probing it at class load isn't needed anymore. ### What changes are included in this PR? - Drop the `allocateDirect(0)` probe call. - Resolve `invokeCleaner` once into a `MethodHandle` bound to `theUnsafe`, instead of going through `Method.invoke` for every buffer. - `Unsafe` is still looked up reflectively to avoid a compile-time dependency on `jdk.unsupported`. If it isn't available, cleaning stays a logged no-op, as before. ### Are these changes tested? Covered by the existing tests: `TestParquetWriterError`, `TestDirectCodecFactory` and the codec tests. ### Are there any user-facing changes? No. The public `cleanDirectBuffer(ByteBuffer)` signature is unchanged. Closes #3898 This pull request and its description were written by Isaac. -- 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]
