RFR: 8361300: Document exceptions for Unsafe offset methods [v2]

Chen Liang liach at openjdk.org
Thu Jul 3 14:08:23 UTC 2025


On Thu, 3 Jul 2025 13:56:24 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.
>
> Chen Liang has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Explicit static checks

Thanks for this permission to update the Atomic updaters. I found that there's no coverage in tck when these IAE on static fields are acknowledged recently, so I took the liberty to add them.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/25945#issuecomment-3032406801


More information about the core-libs-dev mailing list