JDK-8171377 : Add sun.misc.Unsafe::invokeCleaner
  • Type: Bug
  • Component: core-libs
  • Affected Version: 9
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2016-12-16
  • Updated: 2017-05-03
  • Resolved: 2016-12-16
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 b150Fixed
Related Reports
Relates :  
Description
Add a method to sun.misc.Unsafe that invokes the cleaner of a direct byte buffer.

The temporary hack of making direct byte buffer's `cleaner` field Runnable worked ok until jdk-9+148, which brought changes to setAccesssible that can restrict access to private fields in types in exported packages, see JSR 376 proposal tracked as #AwkwardStrongEncapsulation. Since invoking DBB's `cleaner` is an important use-case for some third party libraries, and until a supported means can be achieved in a future release, sun.misc.Unsafe.invokeCleaner has been added.
Comments
This issue is verified due to test sun/misc/InvokeCleaner.java passes.
03-05-2017