RFR: 8361300: Document exceptions for Unsafe offset methods
Chen Liang
liach at openjdk.org
Wed Jul 2 19:26:18 UTC 2025
On Tue, 24 Jun 2025 00:04:54 GMT, Chen Liang <liach at openjdk.org> wrote:
> Unsafe throws IAE for misusing static vs instance fields, and it's revealed that AtomicXxxFieldUpdaters are using this mechanism to reject static fields. This is not a good practice, but we can at least document this so we don't accidentally introduce problems.
For arrayBaseOffset/IndexScale, I don't think I will change it here: they are methods that are exposed via sun.misc.Unsafe.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/25945#issuecomment-3029047897
More information about the core-libs-dev
mailing list