RFR: 8355369: Remove setAccessible usage for setting final fields in java.util.concurrent [v2]

Alan Bateman alanb at openjdk.org
Wed Apr 23 17:38:57 UTC 2025


On Wed, 23 Apr 2025 15:18:49 GMT, Viktor Klang <vklang at openjdk.org> wrote:

>> Viktor Klang has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Adding a releaseFence() to ConcurrentskipListSet.clone()
>
> src/java.base/share/classes/java/util/concurrent/ConcurrentSkipListSet.java line 182:
> 
>> 180:             clone.setMap(new ConcurrentSkipListMap<E,Object>(m));
>> 181:             // Needed to ensure safe publication of setMap()
>> 182:             VarHandle.releaseFence();
> 
> @DougLea This might be interesting to you. 👍

I wonder if we could just change it to return `new ConcurrentSkipListSet<>(m)`. COWAL could be changed to return a new object too.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/24821#discussion_r2056578605


More information about the core-libs-dev mailing list