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: 2022-06-08
  • 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

URL: http://hg.openjdk.java.net/jdk9/jdk9/jdk/rev/0a0a0986400e User: lana Date: 2015-02-04 21:53:46 +0000
04-02-2015

URL: http://hg.openjdk.java.net/jdk9/jdk9/hotspot/rev/e684445431fa User: lana Date: 2015-02-04 21:53:42 +0000
04-02-2015

URL: http://hg.openjdk.java.net/jdk9/hs-rt/hotspot/rev/e684445431fa User: psandoz Date: 2015-01-15 14:35:25 +0000
15-01-2015

URL: http://hg.openjdk.java.net/jdk9/hs-rt/jdk/rev/0a0a0986400e User: psandoz Date: 2015-01-15 14:35:23 +0000
15-01-2015