JDK-8054494 : Remove sun.misc.Unsafe.monitorEnter, monitorExit and tryMonitorEnter
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2014-08-07
  • Updated: 2017-05-17
  • Resolved: 2015-01-15
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 9
9 b49Fixed
Related Reports
Relates :  
Relates :  
Sub Tasks
JDK-8155887 :  
Description
Analysis of the use of methods sun.misc.Unsafe.monitorEnter, monitorExit and tryMonitorEnter on jars in maven central indicates they are not widely used (mostly just one artifact and that is only required to work around a class loading issue on Java 6). 

It is proposed these methods be removed. See the discussion on core-libs:

http://mail.openjdk.java.net/pipermail/core-libs-dev/2014-February/thread.html#25349

Preliminary patches are here:

  http://cr.openjdk.java.net/~psandoz/jdk9/jdk-unsafe-cleanup/webrev/
  http://cr.openjdk.java.net/~psandoz/jdk9/hotspot-unsafe-cleanup/webrev/

Plus another that removes prefetch code that no longer appears to be used:

  http://cr.openjdk.java.net/~psandoz/jdk9/hotspot-unsafe-prefetch-cleanup/webrev/

Comments
Suggested release note text: The methods monitorEnter, monitorExit and tryMonitorEnter on sun.misc.Unsafe are removed in JDK 9. These methods are not used within the JDK itself and are very rarely used outside of the JDK.
05-02-2015