RFR: 8355369: Remove setAccessible usage for setting final fields in java.util.concurrent [v2]
Viktor Klang
vklang at openjdk.org
Thu Apr 24 14:17:17 UTC 2025
On Thu, 24 Apr 2025 11:27:32 GMT, Doug Lea <dl at openjdk.org> wrote:
>> The set only has a map field, and AbstractSet does not define any additional field. The map should be fine too - two fields in AbstractMap are cleared when cloning happens, so recreating a map from a constructor should have the same effect. (Note a significant field `head` is not cleared upon clone, but seems immediately replaced later in `buildFromSorted`). Both should still be fine with this new return values.
>
> As others have mentioned, clone() needs to be re-checked wrt issuing final field fences. But can be conservatively done so here anyway.
@DougLea Yeah. I'd be surprised if `clone()`-invocations were specially tracked to get a trailing release fence inserted before handing out the instance.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/24821#discussion_r2058547956
More information about the core-libs-dev
mailing list