WELD-2613 Remove Unsafe usage from class defining logic. #1978
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.
I am not really happy with this as it means we will be seeing
IllegalAccess
warning again on JDK 11.However,
Unsafe
is a mess in JDK 12+ and not really working, so we cannot rely on that for future solutions anyway. Linked issue has also reported a failure with it on 11 even though we don't know the exact setup (but it has something to do with modular setup which is likely).We now have EE integrators re-routed to the new SPI for several releases, so this problem concerns mainly SE (and possibly servlet?). I don't think there is a solution we could take that would work in both, JDK 8 and JDK 11+ and for declaring classes in JDK 11+ there is likely still the issue of not being able to declare class with different
ProtectionDomain
via new API. I am not sure we need that in SE though.