< prev index next >

src/jdk.unsupported/share/classes/sun/misc/Unsafe.java

Print this page
rev 51958 : 8211122: Reduce the number of internal classes made accessible to jdk.unsupported
Reviewed-by: alanb, dfuchs, kvn

@@ -25,14 +25,12 @@
 
 package sun.misc;
 
 import jdk.internal.vm.annotation.ForceInline;
 import jdk.internal.misc.VM;
-import jdk.internal.ref.Cleaner;
 import jdk.internal.reflect.CallerSensitive;
 import jdk.internal.reflect.Reflection;
-import sun.nio.ch.DirectBuffer;
 
 import java.lang.reflect.Field;
 
 
 /**

@@ -1231,15 +1229,8 @@
      */
     public void invokeCleaner(java.nio.ByteBuffer directBuffer) {
         if (!directBuffer.isDirect())
             throw new IllegalArgumentException("buffer is non-direct");
 
-        DirectBuffer db = (DirectBuffer)directBuffer;
-        if (db.attachment() != null)
-            throw new IllegalArgumentException("duplicate or slice");
-
-        Cleaner cleaner = db.cleaner();
-        if (cleaner != null) {
-            cleaner.clean();
-        }
+        theInternalUnsafe.invokeCleaner(directBuffer);
     }
 }
< prev index next >