JDK-8159995 : Rename internal Unsafe.compare methods
  • Type: Bug
  • Component: core-libs
  • Affected Version: 10
  • Priority: P4
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2016-06-21
  • Updated: 2017-12-12
  • Resolved: 2017-05-11
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 10
10 b08Fixed
Related Reports
Relates :  
Relates :  
Relates :  
Relates :  
Description
Rename the following methods in the internal Unsafe:

- compareAndExchange*Volatile to compareAndExchange*

- compareAndSwap* to compareAndSet*

- weakCompareAndSwap*Volatile -> weakCompareAndSwap

- weakCompareAndSwap* -> weakCompareAndSwap*Plain

Comments
Yes, it would be nice to have it in JDK 9.
22-05-2017

The same problem with Graal (jdk.internal.vm.compiler). It has to add specialization for JDK 10 :) in addition to JDK 9.
22-05-2017

I like these name changes (I lobbied for them in the past!) BUT it breaks jsr166 team's ability to deliver a jsr166.jar that can be used with both jdk9 and jdk10. $ wget -q http://gee.cs.oswego.edu/dl/jsr166/dist/jsr166.jar $ ../jdk10/bin/java --patch-module=java.base=jsr166.jar --help Error occurred during initialization of VM java.lang.NoSuchMethodError: jdk.internal.misc.Unsafe.compareAndSwapInt(Ljava/lang/Object;JII)Z at java.util.concurrent.ConcurrentHashMap.initTable(java.base/ConcurrentHashMap.java:2273) It would make our lives easier (until the next jdk10 incompatibility ...) if this change could be backported to jdk9, which should be low risk.
13-05-2017