--- old/src/java.base/share/classes/java/lang/invoke/MethodHandleNatives.java 2016-01-26 16:37:14.000000000 +0000
+++ new/src/java.base/share/classes/java/lang/invoke/MethodHandleNatives.java 2016-01-26 16:37:13.000000000 +0000
@@ -30,7 +30,7 @@
import static java.lang.invoke.MethodHandleNatives.Constants.*;
import static java.lang.invoke.MethodHandleStatics.*;
import static java.lang.invoke.MethodHandles.Lookup.IMPL_LOOKUP;
-import sun.misc.Cleaner;
+import jdk.internal.ref.Cleaner;
/**
* The JVM interface for the method handles package is all here.
--- old/src/java.base/share/classes/java/lang/ref/Reference.java 2016-01-26 16:37:16.000000000 +0000
+++ new/src/java.base/share/classes/java/lang/ref/Reference.java 2016-01-26 16:37:15.000000000 +0000
@@ -26,10 +26,10 @@
package java.lang.ref;
import jdk.internal.vm.annotation.DontInline;
-import sun.misc.Cleaner;
import jdk.internal.HotSpotIntrinsicCandidate;
import jdk.internal.misc.JavaLangRefAccess;
import jdk.internal.misc.SharedSecrets;
+import jdk.internal.ref.Cleaner;
/**
* Abstract base class for reference objects. This class defines the
--- old/src/java.base/share/classes/java/nio/Direct-X-Buffer.java.template 2016-01-26 16:37:18.000000000 +0000
+++ new/src/java.base/share/classes/java/nio/Direct-X-Buffer.java.template 2016-01-26 16:37:17.000000000 +0000
@@ -28,9 +28,9 @@
package java.nio;
import java.io.FileDescriptor;
-import sun.misc.Cleaner;
import jdk.internal.misc.Unsafe;
import jdk.internal.misc.VM;
+import jdk.internal.ref.Cleaner;
import sun.nio.ch.DirectBuffer;
--- old/src/java.base/share/classes/sun/nio/ch/DirectBuffer.java 2016-01-26 16:37:20.000000000 +0000
+++ new/src/java.base/share/classes/sun/nio/ch/DirectBuffer.java 2016-01-26 16:37:19.000000000 +0000
@@ -25,7 +25,7 @@
package sun.nio.ch;
-import sun.misc.Cleaner;
+import jdk.internal.ref.Cleaner;
public interface DirectBuffer {
--- old/src/java.base/share/classes/sun/nio/ch/FileChannelImpl.java 2016-01-26 16:37:22.000000000 +0000
+++ new/src/java.base/share/classes/sun/nio/ch/FileChannelImpl.java 2016-01-26 16:37:21.000000000 +0000
@@ -47,7 +47,7 @@
import jdk.internal.misc.JavaIOFileDescriptorAccess;
import jdk.internal.misc.JavaNioAccess;
import jdk.internal.misc.SharedSecrets;
-import sun.misc.Cleaner;
+import jdk.internal.ref.Cleaner;
import sun.security.action.GetPropertyAction;
public class FileChannelImpl
--- old/src/java.base/share/classes/sun/nio/ch/IOVecWrapper.java 2016-01-26 16:37:24.000000000 +0000
+++ new/src/java.base/share/classes/sun/nio/ch/IOVecWrapper.java 2016-01-26 16:37:23.000000000 +0000
@@ -26,7 +26,7 @@
package sun.nio.ch;
import java.nio.ByteBuffer;
-import sun.misc.*;
+import jdk.internal.ref.Cleaner;
/**
--- old/src/java.base/share/classes/sun/nio/ch/Util.java 2016-01-26 16:37:26.000000000 +0000
+++ new/src/java.base/share/classes/sun/nio/ch/Util.java 2016-01-26 16:37:25.000000000 +0000
@@ -33,7 +33,7 @@
import java.security.PrivilegedAction;
import java.util.*;
import jdk.internal.misc.Unsafe;
-import sun.misc.Cleaner;
+import jdk.internal.ref.Cleaner;
import sun.security.action.GetPropertyAction;
--- old/src/java.base/share/classes/sun/nio/fs/NativeBuffer.java 2016-01-26 16:37:28.000000000 +0000
+++ new/src/java.base/share/classes/sun/nio/fs/NativeBuffer.java 2016-01-26 16:37:27.000000000 +0000
@@ -26,7 +26,7 @@
package sun.nio.fs;
import jdk.internal.misc.Unsafe;
-import sun.misc.Cleaner;
+import jdk.internal.ref.Cleaner;
/**
* A light-weight buffer in native memory.
--- old/test/TEST.groups 2016-01-26 16:37:30.000000000 +0000
+++ new/test/TEST.groups 2016-01-26 16:37:29.000000000 +0000
@@ -77,6 +77,7 @@
sun/misc \
sun/reflect \
jdk/lambda \
+ jdk/internal/ref \
vm
# All of the java.util package
--- old/src/java.base/share/classes/sun/misc/Cleaner.java 2016-01-26 16:37:32.000000000 +0000
+++ /dev/null 2016-01-26 16:37:32.000000000 +0000
@@ -1,156 +0,0 @@
-/*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.misc;
-
-import java.lang.ref.*;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-
-
-/**
- * General-purpose phantom-reference-based cleaners.
- *
- *
Cleaners are a lightweight and more robust alternative to finalization.
- * They are lightweight because they are not created by the VM and thus do not
- * require a JNI upcall to be created, and because their cleanup code is
- * invoked directly by the reference-handler thread rather than by the
- * finalizer thread. They are more robust because they use phantom references,
- * the weakest type of reference object, thereby avoiding the nasty ordering
- * problems inherent to finalization.
- *
- *
A cleaner tracks a referent object and encapsulates a thunk of arbitrary
- * cleanup code. Some time after the GC detects that a cleaner's referent has
- * become phantom-reachable, the reference-handler thread will run the cleaner.
- * Cleaners may also be invoked directly; they are thread safe and ensure that
- * they run their thunks at most once.
- *
- *
Cleaners are not a replacement for finalization. They should be used
- * only when the cleanup code is extremely simple and straightforward.
- * Nontrivial cleaners are inadvisable since they risk blocking the
- * reference-handler thread and delaying further cleanup and finalization.
- *
- *
- * @author Mark Reinhold
- */
-
-public class Cleaner
- extends PhantomReference