ByteBufferCleaner to check Unsafe access in Java 23+#866
Draft
maxxedev wants to merge 5 commits into
Draft
Conversation
In Java 23+, ByteBufferCleaner should check for access to deprecated memory-access methods in sun.misc.Unsafe
garydgregory
marked this pull request as draft
July 19, 2026 08:33
Member
|
Converting to draft until I can have a closer look, needs clean ups anyway. |
garydgregory
requested changes
Jul 20, 2026
garydgregory
left a comment
Member
There was a problem hiding this comment.
There are several problems here:
- The build fails
- Using
java.lang.managementadds a new module dependency which some people will complain about. We could disallow this through Checkstyle but we currently do not. - It's not clear to me this is the correct implementation since the JEP is just a deprecation.
- There is a bug where
clearWritable()is not called.
Contributor
Author
fixed
we just disable Unsafe access on Java 23+ now
deprecation is for removal. Plus, most users would want the library to not trigger scary warnings.
fixed |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In Java 23+, ByteBufferCleaner should check for access to deprecated memory-access methods in sun.misc.Unsafe
mvn; that'smvnon the command line by itself.