changeset 12808:d8bae0a5bdd2

8137056: Move SharedSecrets and interface friends out of sun.misc Reviewed-by: alanb, mchung, psandoz, rriggs
author chegar
date Mon, 28 Sep 2015 13:39:27 +0100
parents dd3b7365c85e
children 2bea10d2e78f
files src/java.base/share/classes/java/io/Console.java src/java.base/share/classes/java/io/DeleteOnExitHook.java src/java.base/share/classes/java/io/FileOutputStream.java src/java.base/share/classes/java/lang/System.java src/java.base/share/classes/java/lang/Thread.java src/java.base/share/classes/java/lang/ref/Finalizer.java src/java.base/share/classes/java/lang/ref/Reference.java src/java.base/share/classes/java/lang/reflect/Constructor.java src/java.base/share/classes/java/lang/reflect/Executable.java src/java.base/share/classes/java/lang/reflect/Field.java src/java.base/share/classes/java/lang/reflect/Method.java src/java.base/share/classes/java/net/HttpCookie.java src/java.base/share/classes/java/net/InetAddress.java src/java.base/share/classes/java/net/URLClassLoader.java src/java.base/share/classes/java/nio/Bits.java src/java.base/share/classes/java/nio/channels/spi/AbstractInterruptibleChannel.java src/java.base/share/classes/java/security/ProtectionDomain.java src/java.base/share/classes/java/util/EnumMap.java src/java.base/share/classes/java/util/EnumSet.java src/java.base/share/classes/java/util/StringJoiner.java src/java.base/share/classes/java/util/UUID.java src/java.base/share/classes/java/util/jar/JarFile.java src/java.base/share/classes/java/util/jar/JavaUtilJarAccessImpl.java src/java.base/share/classes/java/util/zip/ZipFile.java src/java.base/share/classes/jdk/internal/jimage/ImageNativeSubstrate.java src/java.base/share/classes/jdk/internal/misc/JavaAWTAccess.java src/java.base/share/classes/jdk/internal/misc/JavaAWTFontAccess.java src/java.base/share/classes/jdk/internal/misc/JavaBeansAccess.java src/java.base/share/classes/jdk/internal/misc/JavaIOAccess.java src/java.base/share/classes/jdk/internal/misc/JavaIOFileDescriptorAccess.java src/java.base/share/classes/jdk/internal/misc/JavaLangAccess.java src/java.base/share/classes/jdk/internal/misc/JavaLangRefAccess.java src/java.base/share/classes/jdk/internal/misc/JavaNetAccess.java src/java.base/share/classes/jdk/internal/misc/JavaNetHttpCookieAccess.java src/java.base/share/classes/jdk/internal/misc/JavaNetInetAddressAccess.java src/java.base/share/classes/jdk/internal/misc/JavaNioAccess.java src/java.base/share/classes/jdk/internal/misc/JavaSecurityAccess.java src/java.base/share/classes/jdk/internal/misc/JavaSecurityProtectionDomainAccess.java src/java.base/share/classes/jdk/internal/misc/JavaUtilJarAccess.java src/java.base/share/classes/jdk/internal/misc/JavaUtilZipFileAccess.java src/java.base/share/classes/jdk/internal/misc/SharedSecrets.java src/java.base/share/classes/sun/misc/JavaAWTAccess.java src/java.base/share/classes/sun/misc/JavaAWTFontAccess.java src/java.base/share/classes/sun/misc/JavaBeansAccess.java src/java.base/share/classes/sun/misc/JavaIOAccess.java src/java.base/share/classes/sun/misc/JavaIOFileDescriptorAccess.java src/java.base/share/classes/sun/misc/JavaLangAccess.java src/java.base/share/classes/sun/misc/JavaLangRefAccess.java src/java.base/share/classes/sun/misc/JavaNetAccess.java src/java.base/share/classes/sun/misc/JavaNetHttpCookieAccess.java src/java.base/share/classes/sun/misc/JavaNetInetAddressAccess.java src/java.base/share/classes/sun/misc/JavaNioAccess.java src/java.base/share/classes/sun/misc/JavaSecurityAccess.java src/java.base/share/classes/sun/misc/JavaSecurityProtectionDomainAccess.java src/java.base/share/classes/sun/misc/JavaUtilJarAccess.java src/java.base/share/classes/sun/misc/JavaUtilZipFileAccess.java src/java.base/share/classes/sun/misc/SharedSecrets.java src/java.base/share/classes/sun/misc/URLClassPath.java src/java.base/share/classes/sun/net/sdp/SdpSupport.java src/java.base/share/classes/sun/net/www/protocol/http/HttpURLConnection.java src/java.base/share/classes/sun/nio/ch/FileChannelImpl.java src/java.base/share/classes/sun/reflect/annotation/AnnotationSupport.java src/java.base/share/classes/sun/reflect/annotation/AnnotationType.java src/java.base/share/classes/sun/reflect/annotation/TypeAnnotationParser.java src/java.base/share/classes/sun/security/provider/PolicyFile.java src/java.base/share/classes/sun/security/ssl/SSLSocketImpl.java src/java.base/share/classes/sun/security/util/Password.java src/java.base/share/classes/sun/text/bidi/BidiBase.java src/java.base/share/classes/sun/util/logging/PlatformLogger.java src/java.base/unix/classes/java/io/FileDescriptor.java src/java.base/unix/classes/java/lang/ProcessImpl.java src/java.base/unix/classes/sun/nio/fs/UnixChannelFactory.java src/java.base/windows/classes/java/io/FileDescriptor.java src/java.base/windows/classes/java/lang/ProcessImpl.java src/java.base/windows/classes/java/net/DualStackPlainDatagramSocketImpl.java src/java.base/windows/classes/java/net/DualStackPlainSocketImpl.java src/java.base/windows/classes/sun/nio/ch/FileDispatcherImpl.java src/java.base/windows/classes/sun/nio/ch/WindowsAsynchronousFileChannelImpl.java src/java.base/windows/classes/sun/nio/fs/WindowsChannelFactory.java src/java.desktop/share/classes/com/sun/beans/decoder/DocumentHandler.java src/java.desktop/share/classes/java/awt/EventQueue.java src/java.desktop/share/classes/java/awt/font/JavaAWTFontAccessImpl.java src/java.desktop/share/classes/java/awt/font/NumericShaper.java src/java.desktop/share/classes/java/awt/font/TextAttribute.java src/java.desktop/share/classes/java/beans/Introspector.java src/java.desktop/share/classes/javax/swing/RepaintManager.java src/java.desktop/share/classes/javax/swing/TransferHandler.java src/java.desktop/share/classes/sun/awt/AppContext.java src/java.logging/share/classes/java/util/logging/LogManager.java src/java.logging/share/classes/java/util/logging/LogRecord.java src/java.management/share/classes/com/sun/jmx/mbeanserver/Introspector.java src/java.management/share/classes/com/sun/jmx/mbeanserver/JavaBeansAccessor.java src/java.management/share/classes/javax/management/modelmbean/RequiredModelMBean.java src/java.management/share/classes/sun/management/ManagementFactoryHelper.java src/java.naming/share/classes/com/sun/jndi/ldap/VersionHelper.java src/java.sql/share/classes/java/sql/Date.java src/java.sql/share/classes/java/sql/Time.java src/java.sql/share/classes/java/sql/Timestamp.java test/java/security/ProtectionDomain/PreserveCombinerTest.java test/java/util/logging/LogManagerAppContextDeadlock.java test/java/util/logging/RootLogger/RootLevelInConfigFile.java test/java/util/logging/TestAppletLoggerContext.java test/java/util/logging/TestGetLoggerNPE.java test/jdk/internal/misc/JavaLangAccess/FormatUnsigned.java test/jdk/internal/misc/JavaLangAccess/NewUnsafeString.java test/sun/misc/JavaLangAccess/FormatUnsigned.java test/sun/misc/JavaLangAccess/NewUnsafeString.java
diffstat 107 files changed, 1356 insertions(+), 1258 deletions(-) [+]
line wrap: on
line diff
--- a/src/java.base/share/classes/java/io/Console.java	Mon Sep 28 11:39:13 2015 +0200
+++ b/src/java.base/share/classes/java/io/Console.java	Mon Sep 28 13:39:27 2015 +0100
@@ -27,6 +27,8 @@
 
 import java.util.*;
 import java.nio.charset.Charset;
+import jdk.internal.misc.JavaIOAccess;
+import jdk.internal.misc.SharedSecrets;
 import sun.nio.cs.StreamDecoder;
 import sun.nio.cs.StreamEncoder;
 
@@ -519,7 +521,7 @@
         try {
             // Add a shutdown hook to restore console's echo state should
             // it be necessary.
-            sun.misc.SharedSecrets.getJavaLangAccess()
+            SharedSecrets.getJavaLangAccess()
                 .registerShutdownHook(0 /* shutdown hook invocation order */,
                     false /* only register if shutdown is not in progress */,
                     new Runnable() {
@@ -536,7 +538,7 @@
             // by a shutdown hook
         }
 
-        sun.misc.SharedSecrets.setJavaIOAccess(new sun.misc.JavaIOAccess() {
+        SharedSecrets.setJavaIOAccess(new JavaIOAccess() {
             public Console console() {
                 if (istty()) {
                     if (cons == null)
--- a/src/java.base/share/classes/java/io/DeleteOnExitHook.java	Mon Sep 28 11:39:13 2015 +0200
+++ b/src/java.base/share/classes/java/io/DeleteOnExitHook.java	Mon Sep 28 13:39:27 2015 +0100
@@ -26,6 +26,7 @@
 
 import java.util.*;
 import java.io.File;
+import jdk.internal.misc.SharedSecrets;
 
 /**
  * This class holds a set of filenames to be deleted on VM exit through a shutdown hook.
@@ -41,7 +42,7 @@
         // delete on exit list and cause the DeleteOnExitHook to be
         // registered during shutdown in progress. So set the
         // registerShutdownInProgress parameter to true.
-        sun.misc.SharedSecrets.getJavaLangAccess()
+        SharedSecrets.getJavaLangAccess()
             .registerShutdownHook(2 /* Shutdown hook invocation order */,
                 true /* register even if shutdown in progress */,
                 new Runnable() {
--- a/src/java.base/share/classes/java/io/FileOutputStream.java	Mon Sep 28 11:39:13 2015 +0200
+++ b/src/java.base/share/classes/java/io/FileOutputStream.java	Mon Sep 28 13:39:27 2015 +0100
@@ -27,8 +27,8 @@
 
 import java.nio.channels.FileChannel;
 import java.util.concurrent.atomic.AtomicBoolean;
-import sun.misc.SharedSecrets;
-import sun.misc.JavaIOFileDescriptorAccess;
+import jdk.internal.misc.SharedSecrets;
+import jdk.internal.misc.JavaIOFileDescriptorAccess;
 import sun.nio.ch.FileChannelImpl;
 
 
--- a/src/java.base/share/classes/java/lang/System.java	Mon Sep 28 11:39:13 2015 +0200
+++ b/src/java.base/share/classes/java/lang/System.java	Mon Sep 28 13:39:27 2015 +0100
@@ -43,6 +43,8 @@
 import sun.security.util.SecurityConstants;
 import sun.reflect.annotation.AnnotationType;
 import jdk.internal.HotSpotIntrinsicCandidate;
+import jdk.internal.misc.JavaLangAccess;;
+import jdk.internal.misc.SharedSecrets;;
 
 /**
  * The <code>System</code> class contains several useful class fields
@@ -212,7 +214,7 @@
      public static Console console() {
          if (cons == null) {
              synchronized (System.class) {
-                 cons = sun.misc.SharedSecrets.getJavaIOAccess().console();
+                 cons = SharedSecrets.getJavaIOAccess().console();
              }
          }
          return cons;
@@ -1216,7 +1218,7 @@
 
     private static void setJavaLangAccess() {
         // Allow privileged classes outside of java.lang
-        sun.misc.SharedSecrets.setJavaLangAccess(new sun.misc.JavaLangAccess(){
+        SharedSecrets.setJavaLangAccess(new JavaLangAccess(){
             public sun.reflect.ConstantPool getConstantPool(Class<?> klass) {
                 return klass.getConstantPool();
             }
--- a/src/java.base/share/classes/java/lang/Thread.java	Mon Sep 28 11:39:13 2015 +0200
+++ b/src/java.base/share/classes/java/lang/Thread.java	Mon Sep 28 13:39:27 2015 +0100
@@ -233,7 +233,8 @@
     private volatile Interruptible blocker;
     private final Object blockerLock = new Object();
 
-    /* Set the blocker field; invoked via sun.misc.SharedSecrets from java.nio code
+    /* Set the blocker field; invoked via jdk.internal.misc.SharedSecrets
+     * from java.nio code
      */
     void blockedOn(Interruptible b) {
         synchronized (blockerLock) {
--- a/src/java.base/share/classes/java/lang/ref/Finalizer.java	Mon Sep 28 11:39:13 2015 +0200
+++ b/src/java.base/share/classes/java/lang/ref/Finalizer.java	Mon Sep 28 13:39:27 2015 +0100
@@ -27,9 +27,9 @@
 
 import java.security.PrivilegedAction;
 import java.security.AccessController;
-import sun.misc.JavaLangAccess;
+import jdk.internal.misc.JavaLangAccess;
+import jdk.internal.misc.SharedSecrets;
 import sun.misc.ManagedLocalsThread;
-import sun.misc.SharedSecrets;
 import sun.misc.VM;
 
 final class Finalizer extends FinalReference<Object> { /* Package-private; must be in
--- a/src/java.base/share/classes/java/lang/ref/Reference.java	Mon Sep 28 11:39:13 2015 +0200
+++ b/src/java.base/share/classes/java/lang/ref/Reference.java	Mon Sep 28 13:39:27 2015 +0100
@@ -26,10 +26,10 @@
 package java.lang.ref;
 
 import sun.misc.Cleaner;
-import sun.misc.JavaLangRefAccess;
+import jdk.internal.HotSpotIntrinsicCandidate;
+import jdk.internal.misc.JavaLangRefAccess;
+import jdk.internal.misc.SharedSecrets;
 import sun.misc.ManagedLocalsThread;
-import sun.misc.SharedSecrets;
-import jdk.internal.HotSpotIntrinsicCandidate;
 
 /**
  * Abstract base class for reference objects.  This class defines the
--- a/src/java.base/share/classes/java/lang/reflect/Constructor.java	Mon Sep 28 11:39:13 2015 +0200
+++ b/src/java.base/share/classes/java/lang/reflect/Constructor.java	Mon Sep 28 13:39:27 2015 +0100
@@ -25,6 +25,7 @@
 
 package java.lang.reflect;
 
+import jdk.internal.misc.SharedSecrets;
 import sun.reflect.CallerSensitive;
 import sun.reflect.ConstructorAccessor;
 import sun.reflect.Reflection;
@@ -582,7 +583,7 @@
 
         // A Constructor for an inner class
         return TypeAnnotationParser.buildAnnotatedType(getTypeAnnotationBytes0(),
-                sun.misc.SharedSecrets.getJavaLangAccess().
+                SharedSecrets.getJavaLangAccess().
                     getConstantPool(thisDeclClass),
                 this,
                 thisDeclClass,
--- a/src/java.base/share/classes/java/lang/reflect/Executable.java	Mon Sep 28 11:39:13 2015 +0200
+++ b/src/java.base/share/classes/java/lang/reflect/Executable.java	Mon Sep 28 13:39:27 2015 +0100
@@ -28,6 +28,8 @@
 import java.lang.annotation.*;
 import java.util.Map;
 import java.util.Objects;
+
+import jdk.internal.misc.SharedSecrets;
 import sun.reflect.annotation.AnnotationParser;
 import sun.reflect.annotation.AnnotationSupport;
 import sun.reflect.annotation.TypeAnnotationParser;
@@ -79,7 +81,7 @@
     Annotation[][] parseParameterAnnotations(byte[] parameterAnnotations) {
         return AnnotationParser.parseParameterAnnotations(
                parameterAnnotations,
-               sun.misc.SharedSecrets.getJavaLangAccess().
+               SharedSecrets.getJavaLangAccess().
                getConstantPool(getDeclaringClass()),
                getDeclaringClass());
     }
@@ -601,7 +603,7 @@
                     } else {
                         declAnnos = AnnotationParser.parseAnnotations(
                                 getAnnotationBytes(),
-                                sun.misc.SharedSecrets.getJavaLangAccess().
+                                SharedSecrets.getJavaLangAccess().
                                         getConstantPool(getDeclaringClass()),
                                 getDeclaringClass()
                         );
@@ -638,7 +640,7 @@
      */
     AnnotatedType getAnnotatedReturnType0(Type returnType) {
         return TypeAnnotationParser.buildAnnotatedType(getTypeAnnotationBytes0(),
-                sun.misc.SharedSecrets.getJavaLangAccess().
+                SharedSecrets.getJavaLangAccess().
                         getConstantPool(getDeclaringClass()),
                 this,
                 getDeclaringClass(),
@@ -672,7 +674,7 @@
         if (Modifier.isStatic(this.getModifiers()))
             return null;
         return TypeAnnotationParser.buildAnnotatedType(getTypeAnnotationBytes0(),
-                sun.misc.SharedSecrets.getJavaLangAccess().
+                SharedSecrets.getJavaLangAccess().
                         getConstantPool(getDeclaringClass()),
                 this,
                 getDeclaringClass(),
@@ -696,7 +698,7 @@
      */
     public AnnotatedType[] getAnnotatedParameterTypes() {
         return TypeAnnotationParser.buildAnnotatedTypes(getTypeAnnotationBytes0(),
-                sun.misc.SharedSecrets.getJavaLangAccess().
+                SharedSecrets.getJavaLangAccess().
                         getConstantPool(getDeclaringClass()),
                 this,
                 getDeclaringClass(),
@@ -720,7 +722,7 @@
      */
     public AnnotatedType[] getAnnotatedExceptionTypes() {
         return TypeAnnotationParser.buildAnnotatedTypes(getTypeAnnotationBytes0(),
-                sun.misc.SharedSecrets.getJavaLangAccess().
+                SharedSecrets.getJavaLangAccess().
                         getConstantPool(getDeclaringClass()),
                 this,
                 getDeclaringClass(),
--- a/src/java.base/share/classes/java/lang/reflect/Field.java	Mon Sep 28 11:39:13 2015 +0200
+++ b/src/java.base/share/classes/java/lang/reflect/Field.java	Mon Sep 28 13:39:27 2015 +0100
@@ -25,6 +25,7 @@
 
 package java.lang.reflect;
 
+import jdk.internal.misc.SharedSecrets;
 import sun.reflect.CallerSensitive;
 import sun.reflect.FieldAccessor;
 import sun.reflect.Reflection;
@@ -1152,7 +1153,7 @@
                     } else {
                         declAnnos = AnnotationParser.parseAnnotations(
                                 annotations,
-                                sun.misc.SharedSecrets.getJavaLangAccess()
+                                SharedSecrets.getJavaLangAccess()
                                         .getConstantPool(getDeclaringClass()),
                                 getDeclaringClass());
                     }
@@ -1175,7 +1176,7 @@
      */
     public AnnotatedType getAnnotatedType() {
         return TypeAnnotationParser.buildAnnotatedType(getTypeAnnotationBytes0(),
-                                                       sun.misc.SharedSecrets.getJavaLangAccess().
+                                                       SharedSecrets.getJavaLangAccess().
                                                            getConstantPool(getDeclaringClass()),
                                                        this,
                                                        getDeclaringClass(),
--- a/src/java.base/share/classes/java/lang/reflect/Method.java	Mon Sep 28 11:39:13 2015 +0200
+++ b/src/java.base/share/classes/java/lang/reflect/Method.java	Mon Sep 28 13:39:27 2015 +0100
@@ -26,6 +26,7 @@
 package java.lang.reflect;
 
 import jdk.internal.HotSpotIntrinsicCandidate;
+import jdk.internal.misc.SharedSecrets;
 import sun.reflect.CallerSensitive;
 import sun.reflect.MethodAccessor;
 import sun.reflect.Reflection;
@@ -626,7 +627,7 @@
             getReturnType());
         Object result = AnnotationParser.parseMemberValue(
             memberType, ByteBuffer.wrap(annotationDefault),
-            sun.misc.SharedSecrets.getJavaLangAccess().
+            SharedSecrets.getJavaLangAccess().
                 getConstantPool(getDeclaringClass()),
             getDeclaringClass());
         if (result instanceof sun.reflect.annotation.ExceptionProxy)
--- a/src/java.base/share/classes/java/net/HttpCookie.java	Mon Sep 28 11:39:13 2015 +0200
+++ b/src/java.base/share/classes/java/net/HttpCookie.java	Mon Sep 28 13:39:27 2015 +0100
@@ -35,6 +35,8 @@
 import java.util.Date;
 import java.util.Locale;
 import java.util.Objects;
+import jdk.internal.misc.JavaNetHttpCookieAccess;
+import jdk.internal.misc.SharedSecrets;
 
 /**
  * An HttpCookie object represents an HTTP cookie, which carries state
@@ -971,8 +973,8 @@
     }
 
     static {
-        sun.misc.SharedSecrets.setJavaNetHttpCookieAccess(
-            new sun.misc.JavaNetHttpCookieAccess() {
+        SharedSecrets.setJavaNetHttpCookieAccess(
+            new JavaNetHttpCookieAccess() {
                 public List<HttpCookie> parse(String header) {
                     return HttpCookie.parse(header, true);
                 }
--- a/src/java.base/share/classes/java/net/InetAddress.java	Mon Sep 28 11:39:13 2015 +0200
+++ b/src/java.base/share/classes/java/net/InetAddress.java	Mon Sep 28 13:39:27 2015 +0100
@@ -43,6 +43,8 @@
 import java.util.concurrent.ConcurrentSkipListSet;
 import java.util.concurrent.atomic.AtomicLong;
 
+import jdk.internal.misc.JavaNetInetAddressAccess;
+import jdk.internal.misc.SharedSecrets;
 import sun.security.action.*;
 import sun.net.InetAddressCachePolicy;
 import sun.net.util.IPAddressUtil;
@@ -215,7 +217,7 @@
          * DNS forging.
          *
          * Oracle JSSE provider is using this original hostname, via
-         * sun.misc.JavaNetAccess, for SSL/TLS endpoint identification.
+         * jdk.internal.misc.JavaNetAccess, for SSL/TLS endpoint identification.
          *
          * Note: May define a new public method in the future if necessary.
          */
@@ -297,8 +299,8 @@
                     return null;
                 }
             });
-        sun.misc.SharedSecrets.setJavaNetInetAddressAccess(
-                new sun.misc.JavaNetInetAddressAccess() {
+        SharedSecrets.setJavaNetInetAddressAccess(
+                new JavaNetInetAddressAccess() {
                     public String getOriginalHostName(InetAddress ia) {
                         return ia.holder.getOriginalHostName();
                     }
--- a/src/java.base/share/classes/java/net/URLClassLoader.java	Mon Sep 28 11:39:13 2015 +0200
+++ b/src/java.base/share/classes/java/net/URLClassLoader.java	Mon Sep 28 13:39:27 2015 +0100
@@ -49,6 +49,9 @@
 import java.util.jar.Attributes.Name;
 import java.util.jar.JarFile;
 import java.util.jar.Manifest;
+
+import jdk.internal.misc.JavaNetAccess;
+import jdk.internal.misc.SharedSecrets;
 import sun.misc.Resource;
 import sun.misc.URLClassPath;
 import sun.net.www.ParseUtil;
@@ -769,9 +772,9 @@
     }
 
     static {
-        sun.misc.SharedSecrets.setJavaNetAccess (
-            new sun.misc.JavaNetAccess() {
-                public URLClassPath getURLClassPath (URLClassLoader u) {
+        SharedSecrets.setJavaNetAccess(
+            new JavaNetAccess() {
+                public URLClassPath getURLClassPath(URLClassLoader u) {
                     return u.ucp;
                 }
             }
--- a/src/java.base/share/classes/java/nio/Bits.java	Mon Sep 28 11:39:13 2015 +0200
+++ b/src/java.base/share/classes/java/nio/Bits.java	Mon Sep 28 13:39:27 2015 +0100
@@ -29,8 +29,9 @@
 import java.util.concurrent.atomic.AtomicLong;
 import java.util.concurrent.atomic.LongAdder;
 
-import sun.misc.JavaLangRefAccess;
-import sun.misc.SharedSecrets;
+import jdk.internal.misc.JavaNioAccess;
+import jdk.internal.misc.JavaLangRefAccess;
+import jdk.internal.misc.SharedSecrets;
 import sun.misc.Unsafe;
 import sun.misc.VM;
 
@@ -702,11 +703,11 @@
 
     static {
         // setup access to this package in SharedSecrets
-        sun.misc.SharedSecrets.setJavaNioAccess(
-            new sun.misc.JavaNioAccess() {
+        SharedSecrets.setJavaNioAccess(
+            new JavaNioAccess() {
                 @Override
-                public sun.misc.JavaNioAccess.BufferPool getDirectBufferPool() {
-                    return new sun.misc.JavaNioAccess.BufferPool() {
+                public JavaNioAccess.BufferPool getDirectBufferPool() {
+                    return new JavaNioAccess.BufferPool() {
                         @Override
                         public String getName() {
                             return "direct";
--- a/src/java.base/share/classes/java/nio/channels/spi/AbstractInterruptibleChannel.java	Mon Sep 28 11:39:13 2015 +0200
+++ b/src/java.base/share/classes/java/nio/channels/spi/AbstractInterruptibleChannel.java	Mon Sep 28 13:39:27 2015 +0100
@@ -34,6 +34,7 @@
 import java.nio.channels.*;
 import java.security.AccessController;
 import java.security.PrivilegedAction;
+import jdk.internal.misc.SharedSecrets;
 import sun.nio.ch.Interruptible;
 
 
@@ -206,9 +207,8 @@
     }
 
 
-    // -- sun.misc.SharedSecrets --
+    // -- jdk.internal.misc.SharedSecrets --
     static void blockedOn(Interruptible intr) {         // package-private
-        sun.misc.SharedSecrets.getJavaLangAccess().blockedOn(Thread.currentThread(),
-                                                             intr);
+        SharedSecrets.getJavaLangAccess().blockedOn(Thread.currentThread(), intr);
     }
 }
--- a/src/java.base/share/classes/java/security/ProtectionDomain.java	Mon Sep 28 11:39:13 2015 +0200
+++ b/src/java.base/share/classes/java/security/ProtectionDomain.java	Mon Sep 28 13:39:27 2015 +0100
@@ -34,10 +34,10 @@
 import java.util.Map;
 import java.util.WeakHashMap;
 import java.util.concurrent.ConcurrentHashMap;
-import sun.misc.JavaSecurityAccess;
-import sun.misc.JavaSecurityProtectionDomainAccess;
-import static sun.misc.JavaSecurityProtectionDomainAccess.ProtectionDomainCache;
-import sun.misc.SharedSecrets;
+import jdk.internal.misc.JavaSecurityAccess;
+import jdk.internal.misc.JavaSecurityProtectionDomainAccess;
+import static jdk.internal.misc.JavaSecurityProtectionDomainAccess.ProtectionDomainCache;
+import jdk.internal.misc.SharedSecrets;
 import sun.security.util.Debug;
 import sun.security.util.SecurityConstants;
 
--- a/src/java.base/share/classes/java/util/EnumMap.java	Mon Sep 28 11:39:13 2015 +0200
+++ b/src/java.base/share/classes/java/util/EnumMap.java	Mon Sep 28 13:39:27 2015 +0100
@@ -26,7 +26,7 @@
 package java.util;
 
 import java.util.Map.Entry;
-import sun.misc.SharedSecrets;
+import jdk.internal.misc.SharedSecrets;
 
 /**
  * A specialized {@link Map} implementation for use with enum type keys.  All
--- a/src/java.base/share/classes/java/util/EnumSet.java	Mon Sep 28 11:39:13 2015 +0200
+++ b/src/java.base/share/classes/java/util/EnumSet.java	Mon Sep 28 13:39:27 2015 +0100
@@ -25,7 +25,7 @@
 
 package java.util;
 
-import sun.misc.SharedSecrets;
+import jdk.internal.misc.SharedSecrets;
 
 /**
  * A specialized {@link Set} implementation for use with enum types.  All of
--- a/src/java.base/share/classes/java/util/StringJoiner.java	Mon Sep 28 11:39:13 2015 +0200
+++ b/src/java.base/share/classes/java/util/StringJoiner.java	Mon Sep 28 13:39:27 2015 +0100
@@ -24,8 +24,8 @@
  */
 package java.util;
 
-import sun.misc.JavaLangAccess;
-import sun.misc.SharedSecrets;
+import jdk.internal.misc.JavaLangAccess;
+import jdk.internal.misc.SharedSecrets;
 
 /**
  * {@code StringJoiner} is used to construct a sequence of characters separated
--- a/src/java.base/share/classes/java/util/UUID.java	Mon Sep 28 11:39:13 2015 +0200
+++ b/src/java.base/share/classes/java/util/UUID.java	Mon Sep 28 13:39:27 2015 +0100
@@ -27,8 +27,8 @@
 
 import java.security.*;
 
-import sun.misc.JavaLangAccess;
-import sun.misc.SharedSecrets;
+import jdk.internal.misc.JavaLangAccess;
+import jdk.internal.misc.SharedSecrets;
 
 /**
  * A class that represents an immutable universally unique identifier (UUID).
--- a/src/java.base/share/classes/java/util/jar/JarFile.java	Mon Sep 28 11:39:13 2015 +0200
+++ b/src/java.base/share/classes/java/util/jar/JarFile.java	Mon Sep 28 13:39:27 2015 +0100
@@ -36,10 +36,10 @@
 import java.security.cert.Certificate;
 import java.security.AccessController;
 import java.security.CodeSource;
+import jdk.internal.misc.SharedSecrets;
 import sun.misc.IOUtils;
 import sun.security.action.GetPropertyAction;
 import sun.security.util.ManifestEntryVerifier;
-import sun.misc.SharedSecrets;
 import sun.security.util.SignatureFileVerifier;
 
 /**
--- a/src/java.base/share/classes/java/util/jar/JavaUtilJarAccessImpl.java	Mon Sep 28 11:39:13 2015 +0200
+++ b/src/java.base/share/classes/java/util/jar/JavaUtilJarAccessImpl.java	Mon Sep 28 13:39:27 2015 +0100
@@ -30,7 +30,7 @@
 import java.security.CodeSource;
 import java.util.Enumeration;
 import java.util.List;
-import sun.misc.JavaUtilJarAccess;
+import jdk.internal.misc.JavaUtilJarAccess;
 
 class JavaUtilJarAccessImpl implements JavaUtilJarAccess {
     public boolean jarFileHasClassPathAttribute(JarFile jar) throws IOException {
--- a/src/java.base/share/classes/java/util/zip/ZipFile.java	Mon Sep 28 11:39:13 2015 +0200
+++ b/src/java.base/share/classes/java/util/zip/ZipFile.java	Mon Sep 28 13:39:27 2015 +0100
@@ -44,6 +44,8 @@
 import java.util.WeakHashMap;
 import java.util.stream.Stream;
 import java.util.stream.StreamSupport;
+import jdk.internal.misc.JavaUtilZipFileAccess;
+import jdk.internal.misc.SharedSecrets;
 
 import static java.util.zip.ZipConstants64.*;
 
@@ -781,12 +783,12 @@
     }
 
     static {
-        sun.misc.SharedSecrets.setJavaUtilZipFileAccess(
-            new sun.misc.JavaUtilZipFileAccess() {
+        SharedSecrets.setJavaUtilZipFileAccess(
+            new JavaUtilZipFileAccess() {
                 public boolean startsWithLocHeader(ZipFile zip) {
                     return zip.startsWithLocHeader();
                 }
-             }
+            }
         );
     }
 
--- a/src/java.base/share/classes/jdk/internal/jimage/ImageNativeSubstrate.java	Mon Sep 28 11:39:13 2015 +0200
+++ b/src/java.base/share/classes/jdk/internal/jimage/ImageNativeSubstrate.java	Mon Sep 28 13:39:27 2015 +0100
@@ -27,8 +27,6 @@
 import java.io.IOException;
 import java.nio.ByteBuffer;
 import java.nio.ByteOrder;
-import sun.misc.JavaNioAccess;
-import sun.misc.SharedSecrets;
 
 public final class ImageNativeSubstrate implements ImageSubstrate {
     static {
@@ -42,8 +40,10 @@
             });
      }
 
-    private static final JavaNioAccess NIOACCESS =
-            SharedSecrets.getJavaNioAccess();
+    // TODO: Reinstate when the class below, NIOACCESS, is removed.
+    //private static final JavaNioAccess NIOACCESS =
+    //        SharedSecrets.getJavaNioAccess();
+
 
     private final long id;
     private final long indexAddress;
@@ -161,4 +161,59 @@
     public int[] attributeOffsets() {
         return attributeOffsets(id);
     }
+
+    // TODO: Remove when JRT-FS no longer indirectly depends on ImageNativeSubstrate
+    /**
+     * Reflective wrapper around ShareSecrets JavaNioAccess.
+     *
+     * SharedSecrets and friend interfaces moved from 'sun.misc' to 'jdk.internal.misc'
+     * in 1.9. This class provides the runtime with access to the appropriate
+     * JavaNioAccess methods whether running on 1.9, or lower.
+     */
+    static class NIOACCESS {
+
+        private static final String PKG_PREFIX = "jdk.internal.misc";
+        private static final String LEGACY_PKG_PREFIX = "sun.misc";
+
+        private static final Object javaNioAccess;
+        private static final java.lang.reflect.Method newDirectByteBufferMethod;
+
+        static {
+            try {
+                Class<?> c = getJDKClass("JavaNioAccess");
+
+                java.lang.reflect.Method m =
+                        getJDKClass("SharedSecrets").getDeclaredMethod("getJavaNioAccess");
+                javaNioAccess = m.invoke(null);
+
+                newDirectByteBufferMethod = c.getDeclaredMethod("newDirectByteBuffer",
+                                                                long.class,
+                                                                int.class,
+                                                                Object.class);
+            } catch (ReflectiveOperationException x) {
+                throw new InternalError(x);
+            }
+        }
+
+        private static Class<?> getJDKClass(String name) throws ClassNotFoundException {
+            try {
+                return Class.forName(PKG_PREFIX + "." + name);
+            } catch (ClassNotFoundException x) {
+                try {
+                    return Class.forName(LEGACY_PKG_PREFIX + "." + name);
+                } catch (ClassNotFoundException ex) {
+                    x.addSuppressed(ex);
+                    throw x;
+                }
+            }
+        }
+
+        static ByteBuffer newDirectByteBuffer(long addr, int cap, Object ob) {
+            try {
+                return (ByteBuffer) newDirectByteBufferMethod.invoke(javaNioAccess, addr, cap, ob);
+            } catch (ReflectiveOperationException x) {
+                throw new InternalError(x);
+            }
+        }
+    }
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.base/share/classes/jdk/internal/misc/JavaAWTAccess.java	Mon Sep 28 13:39:27 2015 +0100
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 2011, 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 jdk.internal.misc;
+
+public interface JavaAWTAccess {
+
+    // Returns the AppContext used for applet logging isolation, or null if
+    // no isolation is required.
+    // If there's no applet, or if the caller is a stand alone application,
+    // or running in the main app context, returns null.
+    // Otherwise, returns the AppContext of the calling applet.
+    public Object getAppletContext();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.base/share/classes/jdk/internal/misc/JavaAWTFontAccess.java	Mon Sep 28 13:39:27 2015 +0100
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2014, 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.
+ */
+
+/**
+ * SharedSecrets interface used for the access from java.text.Bidi
+ */
+
+package jdk.internal.misc;
+
+public interface JavaAWTFontAccess {
+
+    // java.awt.font.TextAttribute constants
+    public Object getTextAttributeConstant(String name);
+
+    // java.awt.font.NumericShaper
+    public void shape(Object shaper, char[] text, int start, int count);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.base/share/classes/jdk/internal/misc/JavaBeansAccess.java	Mon Sep 28 13:39:27 2015 +0100
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2014, 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 jdk.internal.misc;
+
+import java.lang.reflect.Constructor;
+import java.lang.reflect.Method;
+
+public interface JavaBeansAccess {
+    /**
+     * Returns the getter method for a property of the given name
+     * @param clazz The JavaBeans class
+     * @param property The property name
+     * @return The resolved property getter method
+     * @throws Exception
+     */
+    Method getReadMethod(Class<?> clazz, String property) throws Exception;
+
+    /**
+     * Return the <b>value</b> attribute of the associated
+     * <code>@ConstructorProperties</code> annotation if that is present.
+     * @param ctr The constructor to extract the annotation value from
+     * @return The {@code value} attribute of the <code>@ConstructorProperties</code>
+     *         annotation or {@code null} if the constructor is not annotated by
+     *         this annotation or the annotation is not accessible.
+     */
+    String[] getConstructorPropertiesValue(Constructor<?> ctr);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.base/share/classes/jdk/internal/misc/JavaIOAccess.java	Mon Sep 28 13:39:27 2015 +0100
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 2005, 2006, 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 jdk.internal.misc;
+
+import java.io.Console;
+import java.nio.charset.Charset;
+
+public interface JavaIOAccess {
+    public Console console();
+    public Charset charset();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.base/share/classes/jdk/internal/misc/JavaIOFileDescriptorAccess.java	Mon Sep 28 13:39:27 2015 +0100
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 2007, 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 jdk.internal.misc;
+
+import java.io.FileDescriptor;
+
+/*
+ * @author Chris Hegarty
+ */
+
+public interface JavaIOFileDescriptorAccess {
+    public void set(FileDescriptor obj, int fd);
+    public int get(FileDescriptor fd);
+    public void setAppend(FileDescriptor obj, boolean append);
+    public boolean getAppend(FileDescriptor obj);
+
+    // Only valid on Windows
+    public void setHandle(FileDescriptor obj, long handle);
+    public long getHandle(FileDescriptor obj);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.base/share/classes/jdk/internal/misc/JavaLangAccess.java	Mon Sep 28 13:39:27 2015 +0100
@@ -0,0 +1,145 @@
+/*
+ * 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 jdk.internal.misc;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Executable;
+import java.security.AccessControlContext;
+import java.util.Map;
+
+import sun.reflect.ConstantPool;
+import sun.reflect.annotation.AnnotationType;
+import sun.nio.ch.Interruptible;
+
+public interface JavaLangAccess {
+    /** Return the constant pool for a class. */
+    ConstantPool getConstantPool(Class<?> klass);
+
+    /**
+     * Compare-And-Swap the AnnotationType instance corresponding to this class.
+     * (This method only applies to annotation types.)
+     */
+    boolean casAnnotationType(Class<?> klass, AnnotationType oldType, AnnotationType newType);
+
+    /**
+     * Get the AnnotationType instance corresponding to this class.
+     * (This method only applies to annotation types.)
+     */
+    AnnotationType getAnnotationType(Class<?> klass);
+
+    /**
+     * Get the declared annotations for a given class, indexed by their types.
+     */
+    Map<Class<? extends Annotation>, Annotation> getDeclaredAnnotationMap(Class<?> klass);
+
+    /**
+     * Get the array of bytes that is the class-file representation
+     * of this Class' annotations.
+     */
+    byte[] getRawClassAnnotations(Class<?> klass);
+
+    /**
+     * Get the array of bytes that is the class-file representation
+     * of this Class' type annotations.
+     */
+    byte[] getRawClassTypeAnnotations(Class<?> klass);
+
+    /**
+     * Get the array of bytes that is the class-file representation
+     * of this Executable's type annotations.
+     */
+    byte[] getRawExecutableTypeAnnotations(Executable executable);
+
+    /**
+     * Returns the elements of an enum class or null if the
+     * Class object does not represent an enum type;
+     * the result is uncloned, cached, and shared by all callers.
+     */
+    <E extends Enum<E>> E[] getEnumConstantsShared(Class<E> klass);
+
+    /** Set thread's blocker field. */
+    void blockedOn(Thread t, Interruptible b);
+
+    /**
+     * Registers a shutdown hook.
+     *
+     * It is expected that this method with registerShutdownInProgress=true
+     * is only used to register DeleteOnExitHook since the first file
+     * may be added to the delete on exit list by the application shutdown
+     * hooks.
+     *
+     * @param slot  the slot in the shutdown hook array, whose element
+     *              will be invoked in order during shutdown
+     * @param registerShutdownInProgress true to allow the hook
+     *        to be registered even if the shutdown is in progress.
+     * @param hook  the hook to be registered
+     *
+     * @throws IllegalStateException if shutdown is in progress and
+     *         the slot is not valid to register.
+     */
+    void registerShutdownHook(int slot, boolean registerShutdownInProgress, Runnable hook);
+
+    /**
+     * Returns the number of stack frames represented by the given throwable.
+     */
+    int getStackTraceDepth(Throwable t);
+
+    /**
+     * Returns the ith StackTraceElement for the given throwable.
+     */
+    StackTraceElement getStackTraceElement(Throwable t, int i);
+
+    /**
+     * Returns a new string backed by the provided character array. The
+     * character array is not copied and must never be modified after the
+     * String is created, in order to fulfill String's contract.
+     *
+     * @param chars the character array to back the string
+     * @return a newly created string whose content is the character array
+     */
+    String newStringUnsafe(char[] chars);
+
+    /**
+     * Returns a new Thread with the given Runnable and an
+     * inherited AccessControlContext.
+     */
+    Thread newThreadWithAcc(Runnable target, AccessControlContext acc);
+
+    /**
+     * Invokes the finalize method of the given object.
+     */
+    void invokeFinalize(Object o) throws Throwable;
+
+    /**
+     * Invokes Long.formatUnsignedLong(long val, int shift, char[] buf, int offset, int len)
+     */
+    void formatUnsignedLong(long val, int shift, char[] buf, int offset, int len);
+
+    /**
+     * Invokes Integer.formatUnsignedInt(long val, int shift, char[] buf, int offset, int len)
+     */
+    void formatUnsignedInt(int val, int shift, char[] buf, int offset, int len);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.base/share/classes/jdk/internal/misc/JavaLangRefAccess.java	Mon Sep 28 13:39:27 2015 +0100
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2014, 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 jdk.internal.misc;
+
+public interface JavaLangRefAccess {
+
+    /**
+     * Help ReferenceHandler thread process next pending
+     * {@link java.lang.ref.Reference}
+     *
+     * @return {@code true} if there was a pending reference and it
+     *         was enqueue-ed or {@code false} if there was no
+     *         pending reference
+     */
+    boolean tryHandlePendingReference();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.base/share/classes/jdk/internal/misc/JavaNetAccess.java	Mon Sep 28 13:39:27 2015 +0100
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 2006, 2015, 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 jdk.internal.misc;
+
+import java.net.URLClassLoader;
+import sun.misc.URLClassPath;
+
+public interface JavaNetAccess {
+    /**
+     * return the URLClassPath belonging to the given loader
+     */
+    URLClassPath getURLClassPath (URLClassLoader u);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.base/share/classes/jdk/internal/misc/JavaNetHttpCookieAccess.java	Mon Sep 28 13:39:27 2015 +0100
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2011, 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 jdk.internal.misc;
+
+import java.net.HttpCookie;
+import java.util.List;
+
+public interface JavaNetHttpCookieAccess {
+    /*
+     * Constructs cookies from Set-Cookie or Set-Cookie2 header string,
+     * retaining the original header String in the cookie itself.
+     */
+    public List<HttpCookie> parse(String header);
+
+    /*
+     * Returns the original header this cookie was constructed from, if it was
+     * constructed by parsing a header, otherwise null.
+     */
+    public String header(HttpCookie cookie);
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.base/share/classes/jdk/internal/misc/JavaNetInetAddressAccess.java	Mon Sep 28 13:39:27 2015 +0100
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 2015, 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 jdk.internal.misc;
+
+import java.net.InetAddress;
+
+public interface JavaNetInetAddressAccess {
+    /**
+     * Return the original application specified hostname of
+     * the given InetAddress object.
+     */
+    String getOriginalHostName(InetAddress ia);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.base/share/classes/jdk/internal/misc/JavaNioAccess.java	Mon Sep 28 13:39:27 2015 +0100
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 2007, 2011, 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 jdk.internal.misc;
+
+import java.nio.Buffer;
+import java.nio.ByteBuffer;
+
+public interface JavaNioAccess {
+    /**
+     * Provides access to information on buffer usage.
+     */
+    interface BufferPool {
+        String getName();
+        long getCount();
+        long getTotalCapacity();
+        long getMemoryUsed();
+    }
+    BufferPool getDirectBufferPool();
+
+    /**
+     * Constructs a direct ByteBuffer referring to the block of memory starting
+     * at the given memory address and extending {@code cap} bytes.
+     * The {@code ob} parameter is an arbitrary object that is attached
+     * to the resulting buffer.
+     */
+    ByteBuffer newDirectByteBuffer(long addr, int cap, Object ob);
+
+    /**
+     * Truncates a buffer by changing its capacity to 0.
+     */
+    void truncate(Buffer buf);
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.base/share/classes/jdk/internal/misc/JavaSecurityAccess.java	Mon Sep 28 13:39:27 2015 +0100
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 2010, 2011, 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 jdk.internal.misc;
+
+import java.security.AccessControlContext;
+import java.security.PrivilegedAction;
+
+public interface JavaSecurityAccess {
+
+    <T> T doIntersectionPrivilege(PrivilegedAction<T> action,
+                                  AccessControlContext stack,
+                                  AccessControlContext context);
+
+    <T> T doIntersectionPrivilege(PrivilegedAction<T> action,
+                                  AccessControlContext context);
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.base/share/classes/jdk/internal/misc/JavaSecurityProtectionDomainAccess.java	Mon Sep 28 13:39:27 2015 +0100
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2009, 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 jdk.internal.misc;
+
+import java.security.PermissionCollection;
+import java.security.ProtectionDomain;
+
+public interface JavaSecurityProtectionDomainAccess {
+    interface ProtectionDomainCache {
+        void put(ProtectionDomain pd, PermissionCollection pc);
+        PermissionCollection get(ProtectionDomain pd);
+    }
+    /**
+     * Returns the ProtectionDomainCache.
+     */
+    ProtectionDomainCache getProtectionDomainCache();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.base/share/classes/jdk/internal/misc/JavaUtilJarAccess.java	Mon Sep 28 13:39:27 2015 +0100
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2002, 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 jdk.internal.misc;
+
+import java.io.IOException;
+import java.net.URL;
+import java.security.CodeSource;
+import java.util.Enumeration;
+import java.util.List;
+import java.util.jar.JarEntry;
+import java.util.jar.JarFile;
+
+public interface JavaUtilJarAccess {
+    public boolean jarFileHasClassPathAttribute(JarFile jar) throws IOException;
+    public CodeSource[] getCodeSources(JarFile jar, URL url);
+    public CodeSource getCodeSource(JarFile jar, URL url, String name);
+    public Enumeration<String> entryNames(JarFile jar, CodeSource[] cs);
+    public Enumeration<JarEntry> entries2(JarFile jar);
+    public void setEagerValidation(JarFile jar, boolean eager);
+    public List<Object> getManifestDigests(JarFile jar);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.base/share/classes/jdk/internal/misc/JavaUtilZipFileAccess.java	Mon Sep 28 13:39:27 2015 +0100
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 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 jdk.internal.misc;
+
+import java.util.zip.ZipFile;
+
+public interface JavaUtilZipFileAccess {
+    public boolean startsWithLocHeader(ZipFile zip);
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.base/share/classes/jdk/internal/misc/SharedSecrets.java	Mon Sep 28 13:39:27 2015 +0100
@@ -0,0 +1,215 @@
+/*
+ * Copyright (c) 2002, 2015, 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 jdk.internal.misc;
+
+import java.util.jar.JarFile;
+import java.io.Console;
+import java.io.FileDescriptor;
+import java.security.ProtectionDomain;
+import java.security.AccessController;
+import sun.misc.Unsafe;
+
+/** A repository of "shared secrets", which are a mechanism for
+    calling implementation-private methods in another package without
+    using reflection. A package-private class implements a public
+    interface and provides the ability to call package-private methods
+    within that package; the object implementing that interface is
+    provided through a third package to which access is restricted.
+    This framework avoids the primary disadvantage of using reflection
+    for this purpose, namely the loss of compile-time checking. */
+
+public class SharedSecrets {
+    private static final Unsafe unsafe = Unsafe.getUnsafe();
+    private static JavaUtilJarAccess javaUtilJarAccess;
+    private static JavaLangAccess javaLangAccess;
+    private static JavaLangRefAccess javaLangRefAccess;
+    private static JavaIOAccess javaIOAccess;
+    private static JavaNetAccess javaNetAccess;
+    private static JavaNetInetAddressAccess javaNetInetAddressAccess;
+    private static JavaNetHttpCookieAccess javaNetHttpCookieAccess;
+    private static JavaNioAccess javaNioAccess;
+    private static JavaIOFileDescriptorAccess javaIOFileDescriptorAccess;
+    private static JavaSecurityProtectionDomainAccess javaSecurityProtectionDomainAccess;
+    private static JavaSecurityAccess javaSecurityAccess;
+    private static JavaUtilZipFileAccess javaUtilZipFileAccess;
+    private static JavaAWTAccess javaAWTAccess;
+    private static JavaAWTFontAccess javaAWTFontAccess;
+    private static JavaBeansAccess javaBeansAccess;
+
+    public static JavaUtilJarAccess javaUtilJarAccess() {
+        if (javaUtilJarAccess == null) {
+            // Ensure JarFile is initialized; we know that that class
+            // provides the shared secret
+            unsafe.ensureClassInitialized(JarFile.class);
+        }
+        return javaUtilJarAccess;
+    }
+
+    public static void setJavaUtilJarAccess(JavaUtilJarAccess access) {
+        javaUtilJarAccess = access;
+    }
+
+    public static void setJavaLangAccess(JavaLangAccess jla) {
+        javaLangAccess = jla;
+    }
+
+    public static JavaLangAccess getJavaLangAccess() {
+        return javaLangAccess;
+    }
+
+    public static void setJavaLangRefAccess(JavaLangRefAccess jlra) {
+        javaLangRefAccess = jlra;
+    }
+
+    public static JavaLangRefAccess getJavaLangRefAccess() {
+        return javaLangRefAccess;
+    }
+
+    public static void setJavaNetAccess(JavaNetAccess jna) {
+        javaNetAccess = jna;
+    }
+
+    public static JavaNetAccess getJavaNetAccess() {
+        if (javaNetAccess == null)
+            unsafe.ensureClassInitialized(java.net.URLClassLoader.class);
+        return javaNetAccess;
+    }
+
+    public static void setJavaNetInetAddressAccess(JavaNetInetAddressAccess jna) {
+        javaNetInetAddressAccess = jna;
+    }
+
+    public static JavaNetInetAddressAccess getJavaNetInetAddressAccess() {
+        return javaNetInetAddressAccess;
+    }
+
+    public static void setJavaNetHttpCookieAccess(JavaNetHttpCookieAccess a) {
+        javaNetHttpCookieAccess = a;
+    }
+
+    public static JavaNetHttpCookieAccess getJavaNetHttpCookieAccess() {
+        if (javaNetHttpCookieAccess == null)
+            unsafe.ensureClassInitialized(java.net.HttpCookie.class);
+        return javaNetHttpCookieAccess;
+    }
+
+    public static void setJavaNioAccess(JavaNioAccess jna) {
+        javaNioAccess = jna;
+    }
+
+    public static JavaNioAccess getJavaNioAccess() {
+        if (javaNioAccess == null) {
+            // Ensure java.nio.ByteOrder is initialized; we know that
+            // this class initializes java.nio.Bits that provides the
+            // shared secret.
+            unsafe.ensureClassInitialized(java.nio.ByteOrder.class);
+        }
+        return javaNioAccess;
+    }
+
+    public static void setJavaIOAccess(JavaIOAccess jia) {
+        javaIOAccess = jia;
+    }
+
+    public static JavaIOAccess getJavaIOAccess() {
+        if (javaIOAccess == null) {
+            unsafe.ensureClassInitialized(Console.class);
+        }
+        return javaIOAccess;
+    }
+
+    public static void setJavaIOFileDescriptorAccess(JavaIOFileDescriptorAccess jiofda) {
+        javaIOFileDescriptorAccess = jiofda;
+    }
+
+    public static JavaIOFileDescriptorAccess getJavaIOFileDescriptorAccess() {
+        if (javaIOFileDescriptorAccess == null)
+            unsafe.ensureClassInitialized(FileDescriptor.class);
+
+        return javaIOFileDescriptorAccess;
+    }
+
+    public static void setJavaSecurityProtectionDomainAccess
+        (JavaSecurityProtectionDomainAccess jspda) {
+            javaSecurityProtectionDomainAccess = jspda;
+    }
+
+    public static JavaSecurityProtectionDomainAccess
+        getJavaSecurityProtectionDomainAccess() {
+            if (javaSecurityProtectionDomainAccess == null)
+                unsafe.ensureClassInitialized(ProtectionDomain.class);
+            return javaSecurityProtectionDomainAccess;
+    }
+
+    public static void setJavaSecurityAccess(JavaSecurityAccess jsa) {
+        javaSecurityAccess = jsa;
+    }
+
+    public static JavaSecurityAccess getJavaSecurityAccess() {
+        if (javaSecurityAccess == null) {
+            unsafe.ensureClassInitialized(AccessController.class);
+        }
+        return javaSecurityAccess;
+    }
+
+    public static JavaUtilZipFileAccess getJavaUtilZipFileAccess() {
+        if (javaUtilZipFileAccess == null)
+            unsafe.ensureClassInitialized(java.util.zip.ZipFile.class);
+        return javaUtilZipFileAccess;
+    }
+
+    public static void setJavaUtilZipFileAccess(JavaUtilZipFileAccess access) {
+        javaUtilZipFileAccess = access;
+    }
+
+    public static void setJavaAWTAccess(JavaAWTAccess jaa) {
+        javaAWTAccess = jaa;
+    }
+
+    public static JavaAWTAccess getJavaAWTAccess() {
+        // this may return null in which case calling code needs to
+        // provision for.
+        return javaAWTAccess;
+    }
+
+    public static void setJavaAWTFontAccess(JavaAWTFontAccess jafa) {
+        javaAWTFontAccess = jafa;
+    }
+
+    public static JavaAWTFontAccess getJavaAWTFontAccess() {
+        // this may return null in which case calling code needs to
+        // provision for.
+        return javaAWTFontAccess;
+    }
+
+    public static JavaBeansAccess getJavaBeansAccess() {
+        return javaBeansAccess;
+    }
+
+    public static void setJavaBeansAccess(JavaBeansAccess access) {
+        javaBeansAccess = access;
+    }
+}
--- a/src/java.base/share/classes/sun/misc/JavaAWTAccess.java	Mon Sep 28 11:39:13 2015 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,36 +0,0 @@
-/*
- * Copyright (c) 2011, 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;
-
-public interface JavaAWTAccess {
-
-    // Returns the AppContext used for applet logging isolation, or null if
-    // no isolation is required.
-    // If there's no applet, or if the caller is a stand alone application,
-    // or running in the main app context, returns null.
-    // Otherwise, returns the AppContext of the calling applet.
-    public Object getAppletContext();
-}
--- a/src/java.base/share/classes/sun/misc/JavaAWTFontAccess.java	Mon Sep 28 11:39:13 2015 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-/*
- * Copyright (c) 2014, 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.
- */
-
-/**
- * SharedSecrets interface used for the access from java.text.Bidi
- */
-
-package sun.misc;
-
-public interface JavaAWTFontAccess {
-
-    // java.awt.font.TextAttribute constants
-    public Object getTextAttributeConstant(String name);
-
-    // java.awt.font.NumericShaper
-    public void shape(Object shaper, char[] text, int start, int count);
-}
--- a/src/java.base/share/classes/sun/misc/JavaBeansAccess.java	Mon Sep 28 11:39:13 2015 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,50 +0,0 @@
-/*
- * Copyright (c) 2014, 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.reflect.Constructor;
-import java.lang.reflect.Method;
-
-public interface JavaBeansAccess {
-    /**
-     * Returns the getter method for a property of the given name
-     * @param clazz The JavaBeans class
-     * @param property The property name
-     * @return The resolved property getter method
-     * @throws Exception
-     */
-    Method getReadMethod(Class<?> clazz, String property) throws Exception;
-
-    /**
-     * Return the <b>value</b> attribute of the associated
-     * <code>@ConstructorProperties</code> annotation if that is present.
-     * @param ctr The constructor to extract the annotation value from
-     * @return The {@code value} attribute of the <code>@ConstructorProperties</code>
-     *         annotation or {@code null} if the constructor is not annotated by
-     *         this annotation or the annotation is not accessible.
-     */
-    String[] getConstructorPropertiesValue(Constructor<?> ctr);
-}
--- a/src/java.base/share/classes/sun/misc/JavaIOAccess.java	Mon Sep 28 11:39:13 2015 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,33 +0,0 @@
-/*
- * Copyright (c) 2005, 2006, 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.io.Console;
-import java.nio.charset.Charset;
-
-public interface JavaIOAccess {
-    public Console console();
-    public Charset charset();
-}
--- a/src/java.base/share/classes/sun/misc/JavaIOFileDescriptorAccess.java	Mon Sep 28 11:39:13 2015 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,42 +0,0 @@
-/*
- * Copyright (c) 2007, 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.io.FileDescriptor;
-
-/*
- * @author Chris Hegarty
- */
-
-public interface JavaIOFileDescriptorAccess {
-    public void set(FileDescriptor obj, int fd);
-    public int get(FileDescriptor fd);
-    public void setAppend(FileDescriptor obj, boolean append);
-    public boolean getAppend(FileDescriptor obj);
-
-    // Only valid on Windows
-    public void setHandle(FileDescriptor obj, long handle);
-    public long getHandle(FileDescriptor obj);
-}
--- a/src/java.base/share/classes/sun/misc/JavaLangAccess.java	Mon Sep 28 11:39:13 2015 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,145 +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.annotation.Annotation;
-import java.lang.reflect.Executable;
-import java.security.AccessControlContext;
-import java.util.Map;
-
-import sun.reflect.ConstantPool;
-import sun.reflect.annotation.AnnotationType;
-import sun.nio.ch.Interruptible;
-
-public interface JavaLangAccess {
-    /** Return the constant pool for a class. */
-    ConstantPool getConstantPool(Class<?> klass);
-
-    /**
-     * Compare-And-Swap the AnnotationType instance corresponding to this class.
-     * (This method only applies to annotation types.)
-     */
-    boolean casAnnotationType(Class<?> klass, AnnotationType oldType, AnnotationType newType);
-
-    /**
-     * Get the AnnotationType instance corresponding to this class.
-     * (This method only applies to annotation types.)
-     */
-    AnnotationType getAnnotationType(Class<?> klass);
-
-    /**
-     * Get the declared annotations for a given class, indexed by their types.
-     */
-    Map<Class<? extends Annotation>, Annotation> getDeclaredAnnotationMap(Class<?> klass);
-
-    /**
-     * Get the array of bytes that is the class-file representation
-     * of this Class' annotations.
-     */
-    byte[] getRawClassAnnotations(Class<?> klass);
-
-    /**
-     * Get the array of bytes that is the class-file representation
-     * of this Class' type annotations.
-     */
-    byte[] getRawClassTypeAnnotations(Class<?> klass);
-
-    /**
-     * Get the array of bytes that is the class-file representation
-     * of this Executable's type annotations.
-     */
-    byte[] getRawExecutableTypeAnnotations(Executable executable);
-
-    /**
-     * Returns the elements of an enum class or null if the
-     * Class object does not represent an enum type;
-     * the result is uncloned, cached, and shared by all callers.
-     */
-    <E extends Enum<E>> E[] getEnumConstantsShared(Class<E> klass);
-
-    /** Set thread's blocker field. */
-    void blockedOn(Thread t, Interruptible b);
-
-    /**
-     * Registers a shutdown hook.
-     *
-     * It is expected that this method with registerShutdownInProgress=true
-     * is only used to register DeleteOnExitHook since the first file
-     * may be added to the delete on exit list by the application shutdown
-     * hooks.
-     *
-     * @param slot  the slot in the shutdown hook array, whose element
-     *              will be invoked in order during shutdown
-     * @param registerShutdownInProgress true to allow the hook
-     *        to be registered even if the shutdown is in progress.
-     * @param hook  the hook to be registered
-     *
-     * @throws IllegalStateException if shutdown is in progress and
-     *         the slot is not valid to register.
-     */
-    void registerShutdownHook(int slot, boolean registerShutdownInProgress, Runnable hook);
-
-    /**
-     * Returns the number of stack frames represented by the given throwable.
-     */
-    int getStackTraceDepth(Throwable t);
-
-    /**
-     * Returns the ith StackTraceElement for the given throwable.
-     */
-    StackTraceElement getStackTraceElement(Throwable t, int i);
-
-    /**
-     * Returns a new string backed by the provided character array. The
-     * character array is not copied and must never be modified after the
-     * String is created, in order to fulfill String's contract.
-     *
-     * @param chars the character array to back the string
-     * @return a newly created string whose content is the character array
-     */
-    String newStringUnsafe(char[] chars);
-
-    /**
-     * Returns a new Thread with the given Runnable and an
-     * inherited AccessControlContext.
-     */
-    Thread newThreadWithAcc(Runnable target, AccessControlContext acc);
-
-    /**
-     * Invokes the finalize method of the given object.
-     */
-    void invokeFinalize(Object o) throws Throwable;
-
-    /**
-     * Invokes Long.formatUnsignedLong(long val, int shift, char[] buf, int offset, int len)
-     */
-    void formatUnsignedLong(long val, int shift, char[] buf, int offset, int len);
-
-    /**
-     * Invokes Integer.formatUnsignedInt(long val, int shift, char[] buf, int offset, int len)
-     */
-    void formatUnsignedInt(int val, int shift, char[] buf, int offset, int len);
-}
--- a/src/java.base/share/classes/sun/misc/JavaLangRefAccess.java	Mon Sep 28 11:39:13 2015 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-/*
- * Copyright (c) 2014, 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;
-
-public interface JavaLangRefAccess {
-
-    /**
-     * Help ReferenceHandler thread process next pending
-     * {@link java.lang.ref.Reference}
-     *
-     * @return {@code true} if there was a pending reference and it
-     *         was enqueue-ed or {@code false} if there was no
-     *         pending reference
-     */
-    boolean tryHandlePendingReference();
-}
--- a/src/java.base/share/classes/sun/misc/JavaNetAccess.java	Mon Sep 28 11:39:13 2015 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +0,0 @@
-/*
- * Copyright (c) 2006, 2015, 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.net.URLClassLoader;
-
-public interface JavaNetAccess {
-    /**
-     * return the URLClassPath belonging to the given loader
-     */
-    URLClassPath getURLClassPath (URLClassLoader u);
-}
--- a/src/java.base/share/classes/sun/misc/JavaNetHttpCookieAccess.java	Mon Sep 28 11:39:13 2015 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,44 +0,0 @@
-/*
- * Copyright (c) 2011, 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.net.HttpCookie;
-import java.util.List;
-
-public interface JavaNetHttpCookieAccess {
-    /*
-     * Constructs cookies from Set-Cookie or Set-Cookie2 header string,
-     * retaining the original header String in the cookie itself.
-     */
-    public List<HttpCookie> parse(String header);
-
-    /*
-     * Returns the original header this cookie was constructed from, if it was
-     * constructed by parsing a header, otherwise null.
-     */
-    public String header(HttpCookie cookie);
-}
-
--- a/src/java.base/share/classes/sun/misc/JavaNetInetAddressAccess.java	Mon Sep 28 11:39:13 2015 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,36 +0,0 @@
-/*
- * Copyright (c) 2015, 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.net.InetAddress;
-
-public interface JavaNetInetAddressAccess {
-    /**
-     * Return the original application specified hostname of
-     * the given InetAddress object.
-     */
-    String getOriginalHostName(InetAddress ia);
-}
--- a/src/java.base/share/classes/sun/misc/JavaNioAccess.java	Mon Sep 28 11:39:13 2015 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,56 +0,0 @@
-/*
- * Copyright (c) 2007, 2011, 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.nio.Buffer;
-import java.nio.ByteBuffer;
-
-public interface JavaNioAccess {
-    /**
-     * Provides access to information on buffer usage.
-     */
-    interface BufferPool {
-        String getName();
-        long getCount();
-        long getTotalCapacity();
-        long getMemoryUsed();
-    }
-    BufferPool getDirectBufferPool();
-
-    /**
-     * Constructs a direct ByteBuffer referring to the block of memory starting
-     * at the given memory address and extending {@code cap} bytes.
-     * The {@code ob} parameter is an arbitrary object that is attached
-     * to the resulting buffer.
-     */
-    ByteBuffer newDirectByteBuffer(long addr, int cap, Object ob);
-
-    /**
-     * Truncates a buffer by changing its capacity to 0.
-     */
-    void truncate(Buffer buf);
-
-}
--- a/src/java.base/share/classes/sun/misc/JavaSecurityAccess.java	Mon Sep 28 11:39:13 2015 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,40 +0,0 @@
-/*
- * Copyright (c) 2010, 2011, 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.security.AccessControlContext;
-import java.security.PrivilegedAction;
-
-public interface JavaSecurityAccess {
-
-    <T> T doIntersectionPrivilege(PrivilegedAction<T> action,
-                                  AccessControlContext stack,
-                                  AccessControlContext context);
-
-    <T> T doIntersectionPrivilege(PrivilegedAction<T> action,
-                                  AccessControlContext context);
-
-}
--- a/src/java.base/share/classes/sun/misc/JavaSecurityProtectionDomainAccess.java	Mon Sep 28 11:39:13 2015 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-/*
- * Copyright (c) 2009, 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.security.PermissionCollection;
-import java.security.ProtectionDomain;
-
-public interface JavaSecurityProtectionDomainAccess {
-    interface ProtectionDomainCache {
-        void put(ProtectionDomain pd, PermissionCollection pc);
-        PermissionCollection get(ProtectionDomain pd);
-    }
-    /**
-     * Returns the ProtectionDomainCache.
-     */
-    ProtectionDomainCache getProtectionDomainCache();
-}
--- a/src/java.base/share/classes/sun/misc/JavaUtilJarAccess.java	Mon Sep 28 11:39:13 2015 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,44 +0,0 @@
-/*
- * Copyright (c) 2002, 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.io.IOException;
-import java.net.URL;
-import java.security.CodeSource;
-import java.util.Enumeration;
-import java.util.List;
-import java.util.jar.JarEntry;
-import java.util.jar.JarFile;
-
-public interface JavaUtilJarAccess {
-    public boolean jarFileHasClassPathAttribute(JarFile jar) throws IOException;
-    public CodeSource[] getCodeSources(JarFile jar, URL url);
-    public CodeSource getCodeSource(JarFile jar, URL url, String name);
-    public Enumeration<String> entryNames(JarFile jar, CodeSource[] cs);
-    public Enumeration<JarEntry> entries2(JarFile jar);
-    public void setEagerValidation(JarFile jar, boolean eager);
-    public List<Object> getManifestDigests(JarFile jar);
-}
--- a/src/java.base/share/classes/sun/misc/JavaUtilZipFileAccess.java	Mon Sep 28 11:39:13 2015 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,33 +0,0 @@
-/*
- * Copyright (c) 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.util.zip.ZipFile;
-
-public interface JavaUtilZipFileAccess {
-    public boolean startsWithLocHeader(ZipFile zip);
-}
-
--- a/src/java.base/share/classes/sun/misc/SharedSecrets.java	Mon Sep 28 11:39:13 2015 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,215 +0,0 @@
-/*
- * Copyright (c) 2002, 2015, 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.util.jar.JarFile;
-import java.io.Console;
-import java.io.FileDescriptor;
-import java.security.ProtectionDomain;
-
-import java.security.AccessController;
-
-/** A repository of "shared secrets", which are a mechanism for
-    calling implementation-private methods in another package without
-    using reflection. A package-private class implements a public
-    interface and provides the ability to call package-private methods
-    within that package; the object implementing that interface is
-    provided through a third package to which access is restricted.
-    This framework avoids the primary disadvantage of using reflection
-    for this purpose, namely the loss of compile-time checking. */
-
-public class SharedSecrets {
-    private static final Unsafe unsafe = Unsafe.getUnsafe();
-    private static JavaUtilJarAccess javaUtilJarAccess;
-    private static JavaLangAccess javaLangAccess;
-    private static JavaLangRefAccess javaLangRefAccess;
-    private static JavaIOAccess javaIOAccess;
-    private static JavaNetAccess javaNetAccess;
-    private static JavaNetInetAddressAccess javaNetInetAddressAccess;
-    private static JavaNetHttpCookieAccess javaNetHttpCookieAccess;
-    private static JavaNioAccess javaNioAccess;
-    private static JavaIOFileDescriptorAccess javaIOFileDescriptorAccess;
-    private static JavaSecurityProtectionDomainAccess javaSecurityProtectionDomainAccess;
-    private static JavaSecurityAccess javaSecurityAccess;
-    private static JavaUtilZipFileAccess javaUtilZipFileAccess;
-    private static JavaAWTAccess javaAWTAccess;
-    private static JavaAWTFontAccess javaAWTFontAccess;
-    private static JavaBeansAccess javaBeansAccess;
-
-    public static JavaUtilJarAccess javaUtilJarAccess() {
-        if (javaUtilJarAccess == null) {
-            // Ensure JarFile is initialized; we know that that class
-            // provides the shared secret
-            unsafe.ensureClassInitialized(JarFile.class);
-        }
-        return javaUtilJarAccess;
-    }
-
-    public static void setJavaUtilJarAccess(JavaUtilJarAccess access) {
-        javaUtilJarAccess = access;
-    }
-
-    public static void setJavaLangAccess(JavaLangAccess jla) {
-        javaLangAccess = jla;
-    }
-
-    public static JavaLangAccess getJavaLangAccess() {
-        return javaLangAccess;
-    }
-
-    public static void setJavaLangRefAccess(JavaLangRefAccess jlra) {
-        javaLangRefAccess = jlra;
-    }
-
-    public static JavaLangRefAccess getJavaLangRefAccess() {
-        return javaLangRefAccess;
-    }
-
-    public static void setJavaNetAccess(JavaNetAccess jna) {
-        javaNetAccess = jna;
-    }
-
-    public static JavaNetAccess getJavaNetAccess() {
-        if (javaNetAccess == null)
-            unsafe.ensureClassInitialized(java.net.URLClassLoader.class);
-        return javaNetAccess;
-    }
-
-    public static void setJavaNetInetAddressAccess(JavaNetInetAddressAccess jna) {
-        javaNetInetAddressAccess = jna;
-    }
-
-    public static JavaNetInetAddressAccess getJavaNetInetAddressAccess() {
-        return javaNetInetAddressAccess;
-    }
-
-    public static void setJavaNetHttpCookieAccess(JavaNetHttpCookieAccess a) {
-        javaNetHttpCookieAccess = a;
-    }
-
-    public static JavaNetHttpCookieAccess getJavaNetHttpCookieAccess() {
-        if (javaNetHttpCookieAccess == null)
-            unsafe.ensureClassInitialized(java.net.HttpCookie.class);
-        return javaNetHttpCookieAccess;
-    }
-
-    public static void setJavaNioAccess(JavaNioAccess jna) {
-        javaNioAccess = jna;
-    }
-
-    public static JavaNioAccess getJavaNioAccess() {
-        if (javaNioAccess == null) {
-            // Ensure java.nio.ByteOrder is initialized; we know that
-            // this class initializes java.nio.Bits that provides the
-            // shared secret.
-            unsafe.ensureClassInitialized(java.nio.ByteOrder.class);
-        }
-        return javaNioAccess;
-    }
-
-    public static void setJavaIOAccess(JavaIOAccess jia) {
-        javaIOAccess = jia;
-    }
-
-    public static JavaIOAccess getJavaIOAccess() {
-        if (javaIOAccess == null) {
-            unsafe.ensureClassInitialized(Console.class);
-        }
-        return javaIOAccess;
-    }
-
-    public static void setJavaIOFileDescriptorAccess(JavaIOFileDescriptorAccess jiofda) {
-        javaIOFileDescriptorAccess = jiofda;
-    }
-
-    public static JavaIOFileDescriptorAccess getJavaIOFileDescriptorAccess() {
-        if (javaIOFileDescriptorAccess == null)
-            unsafe.ensureClassInitialized(FileDescriptor.class);
-
-        return javaIOFileDescriptorAccess;
-    }
-
-    public static void setJavaSecurityProtectionDomainAccess
-        (JavaSecurityProtectionDomainAccess jspda) {
-            javaSecurityProtectionDomainAccess = jspda;
-    }
-
-    public static JavaSecurityProtectionDomainAccess
-        getJavaSecurityProtectionDomainAccess() {
-            if (javaSecurityProtectionDomainAccess == null)
-                unsafe.ensureClassInitialized(ProtectionDomain.class);
-            return javaSecurityProtectionDomainAccess;
-    }
-
-    public static void setJavaSecurityAccess(JavaSecurityAccess jsa) {
-        javaSecurityAccess = jsa;
-    }
-
-    public static JavaSecurityAccess getJavaSecurityAccess() {
-        if (javaSecurityAccess == null) {
-            unsafe.ensureClassInitialized(AccessController.class);
-        }
-        return javaSecurityAccess;
-    }
-
-    public static JavaUtilZipFileAccess getJavaUtilZipFileAccess() {
-        if (javaUtilZipFileAccess == null)
-            unsafe.ensureClassInitialized(java.util.zip.ZipFile.class);
-        return javaUtilZipFileAccess;
-    }
-
-    public static void setJavaUtilZipFileAccess(JavaUtilZipFileAccess access) {
-        javaUtilZipFileAccess = access;
-    }
-
-    public static void setJavaAWTAccess(JavaAWTAccess jaa) {
-        javaAWTAccess = jaa;
-    }
-
-    public static JavaAWTAccess getJavaAWTAccess() {
-        // this may return null in which case calling code needs to
-        // provision for.
-        return javaAWTAccess;
-    }
-
-    public static void setJavaAWTFontAccess(JavaAWTFontAccess jafa) {
-        javaAWTFontAccess = jafa;
-    }
-
-    public static JavaAWTFontAccess getJavaAWTFontAccess() {
-        // this may return null in which case calling code needs to
-        // provision for.
-        return javaAWTFontAccess;
-    }
-
-    public static JavaBeansAccess getJavaBeansAccess() {
-        return javaBeansAccess;
-    }
-
-    public static void setJavaBeansAccess(JavaBeansAccess access) {
-        javaBeansAccess = access;
-    }
-}
--- a/src/java.base/share/classes/sun/misc/URLClassPath.java	Mon Sep 28 11:39:13 2015 +0200
+++ b/src/java.base/share/classes/sun/misc/URLClassPath.java	Mon Sep 28 13:39:27 2015 +0100
@@ -66,6 +66,8 @@
 
 import jdk.internal.jimage.ImageLocation;
 import jdk.internal.jimage.ImageReader;
+import jdk.internal.misc.JavaUtilZipFileAccess;
+import jdk.internal.misc.SharedSecrets;
 
 import sun.net.util.URLUtil;
 import sun.net.www.ParseUtil;
@@ -622,8 +624,8 @@
         private URLStreamHandler handler;
         private HashMap<String, Loader> lmap;
         private boolean closed = false;
-        private static final sun.misc.JavaUtilZipFileAccess zipAccess =
-                sun.misc.SharedSecrets.getJavaUtilZipFileAccess();
+        private static final JavaUtilZipFileAccess zipAccess =
+                SharedSecrets.getJavaUtilZipFileAccess();
 
         /*
          * Creates a new JarLoader for the specified URL referring to
--- a/src/java.base/share/classes/sun/net/sdp/SdpSupport.java	Mon Sep 28 11:39:13 2015 +0200
+++ b/src/java.base/share/classes/sun/net/sdp/SdpSupport.java	Mon Sep 28 13:39:27 2015 +0100
@@ -29,8 +29,8 @@
 import java.io.FileDescriptor;
 import java.security.AccessController;
 
-import sun.misc.SharedSecrets;
-import sun.misc.JavaIOFileDescriptorAccess;
+import jdk.internal.misc.SharedSecrets;
+import jdk.internal.misc.JavaIOFileDescriptorAccess;
 
 
 /**
--- a/src/java.base/share/classes/sun/net/www/protocol/http/HttpURLConnection.java	Mon Sep 28 11:39:13 2015 +0200
+++ b/src/java.base/share/classes/sun/net/www/protocol/http/HttpURLConnection.java	Mon Sep 28 13:39:27 2015 +0100
@@ -65,6 +65,8 @@
 import java.util.HashMap;
 import java.util.Set;
 import java.util.StringJoiner;
+import jdk.internal.misc.JavaNetHttpCookieAccess;
+import jdk.internal.misc.SharedSecrets;
 import sun.net.*;
 import sun.net.www.*;
 import sun.net.www.http.HttpClient;
@@ -2878,8 +2880,8 @@
             if (cookieHandler == null || value.length() == 0)
                 return value;
 
-            sun.misc.JavaNetHttpCookieAccess access =
-                    sun.misc.SharedSecrets.getJavaNetHttpCookieAccess();
+            JavaNetHttpCookieAccess access =
+                    SharedSecrets.getJavaNetHttpCookieAccess();
             StringJoiner retValue = new StringJoiner(",");  // RFC 2965, comma separated
             List<HttpCookie> cookies = access.parse(value);
             for (HttpCookie cookie : cookies) {
--- a/src/java.base/share/classes/sun/nio/ch/FileChannelImpl.java	Mon Sep 28 11:39:13 2015 +0200
+++ b/src/java.base/share/classes/sun/nio/ch/FileChannelImpl.java	Mon Sep 28 13:39:27 2015 +0100
@@ -44,9 +44,10 @@
 import java.util.ArrayList;
 import java.util.List;
 
+import jdk.internal.misc.JavaIOFileDescriptorAccess;
+import jdk.internal.misc.JavaNioAccess;
+import jdk.internal.misc.SharedSecrets;
 import sun.misc.Cleaner;
-import sun.misc.JavaIOFileDescriptorAccess;
-import sun.misc.SharedSecrets;
 import sun.security.action.GetPropertyAction;
 
 public class FileChannelImpl
@@ -976,8 +977,8 @@
      * Invoked by sun.management.ManagementFactoryHelper to create the management
      * interface for mapped buffers.
      */
-    public static sun.misc.JavaNioAccess.BufferPool getMappedBufferPool() {
-        return new sun.misc.JavaNioAccess.BufferPool() {
+    public static JavaNioAccess.BufferPool getMappedBufferPool() {
+        return new JavaNioAccess.BufferPool() {
             @Override
             public String getName() {
                 return "mapped";
--- a/src/java.base/share/classes/sun/reflect/annotation/AnnotationSupport.java	Mon Sep 28 11:39:13 2015 +0200
+++ b/src/java.base/share/classes/sun/reflect/annotation/AnnotationSupport.java	Mon Sep 28 13:39:27 2015 +0100
@@ -35,12 +35,12 @@
 import java.util.Map;
 import java.util.Objects;
 
-import sun.misc.JavaLangAccess;
-import sun.reflect.LangReflectAccess;
+import jdk.internal.misc.SharedSecrets;
+import jdk.internal.misc.JavaLangAccess;
 import sun.reflect.ReflectionFactory;
 
 public final class AnnotationSupport {
-    private static final JavaLangAccess LANG_ACCESS = sun.misc.SharedSecrets.getJavaLangAccess();
+    private static final JavaLangAccess LANG_ACCESS = SharedSecrets.getJavaLangAccess();
 
     /**
      * Finds and returns all annotations in {@code annotations} matching
--- a/src/java.base/share/classes/sun/reflect/annotation/AnnotationType.java	Mon Sep 28 11:39:13 2015 +0200
+++ b/src/java.base/share/classes/sun/reflect/annotation/AnnotationType.java	Mon Sep 28 13:39:27 2015 +0100
@@ -25,13 +25,13 @@
 
 package sun.reflect.annotation;
 
-import sun.misc.JavaLangAccess;
-
 import java.lang.annotation.*;
 import java.lang.reflect.*;
 import java.util.*;
 import java.security.AccessController;
 import java.security.PrivilegedAction;
+import jdk.internal.misc.SharedSecrets;
+import jdk.internal.misc.JavaLangAccess;
 
 /**
  * Represents an annotation type at run time.  Used to type-check annotations
@@ -79,7 +79,7 @@
     public static AnnotationType getInstance(
         Class<? extends Annotation> annotationClass)
     {
-        JavaLangAccess jla = sun.misc.SharedSecrets.getJavaLangAccess();
+        JavaLangAccess jla = SharedSecrets.getJavaLangAccess();
         AnnotationType result = jla.getAnnotationType(annotationClass); // volatile read
         if (result == null) {
             result = new AnnotationType(annotationClass);
@@ -134,7 +134,7 @@
         // of the corresponding annotation types breaks infinite recursion.
         if (annotationClass != Retention.class &&
             annotationClass != Inherited.class) {
-            JavaLangAccess jla = sun.misc.SharedSecrets.getJavaLangAccess();
+            JavaLangAccess jla = SharedSecrets.getJavaLangAccess();
             Map<Class<? extends Annotation>, Annotation> metaAnnotations =
                 AnnotationParser.parseSelectAnnotations(
                     jla.getRawClassAnnotations(annotationClass),
--- a/src/java.base/share/classes/sun/reflect/annotation/TypeAnnotationParser.java	Mon Sep 28 11:39:13 2015 +0200
+++ b/src/java.base/share/classes/sun/reflect/annotation/TypeAnnotationParser.java	Mon Sep 28 13:39:27 2015 +0100
@@ -35,7 +35,8 @@
 import java.util.HashMap;
 import java.util.LinkedHashMap;
 import java.util.Map;
-import sun.misc.JavaLangAccess;
+import jdk.internal.misc.SharedSecrets;
+import jdk.internal.misc.JavaLangAccess;
 import sun.reflect.ConstantPool;
 import static sun.reflect.annotation.TypeAnnotation.*;
 
@@ -309,7 +310,7 @@
     static TypeAnnotation[] parseAllTypeAnnotations(AnnotatedElement decl) {
         Class<?> container;
         byte[] rawBytes;
-        JavaLangAccess javaLangAccess = sun.misc.SharedSecrets.getJavaLangAccess();
+        JavaLangAccess javaLangAccess = SharedSecrets.getJavaLangAccess();
         if (decl instanceof Class) {
             container = (Class<?>)decl;
             rawBytes = javaLangAccess.getRawClassTypeAnnotations(container);
--- a/src/java.base/share/classes/sun/security/provider/PolicyFile.java	Mon Sep 28 11:39:13 2015 +0200
+++ b/src/java.base/share/classes/sun/security/provider/PolicyFile.java	Mon Sep 28 13:39:27 2015 +0100
@@ -41,9 +41,9 @@
 import java.net.SocketPermission;
 import java.net.NetPermission;
 import java.util.concurrent.atomic.AtomicReference;
-import sun.misc.JavaSecurityProtectionDomainAccess;
-import static sun.misc.JavaSecurityProtectionDomainAccess.ProtectionDomainCache;
-import sun.misc.SharedSecrets;
+import jdk.internal.misc.JavaSecurityProtectionDomainAccess;
+import static jdk.internal.misc.JavaSecurityProtectionDomainAccess.ProtectionDomainCache;
+import jdk.internal.misc.SharedSecrets;
 import sun.security.util.PolicyUtil;
 import sun.security.util.PropertyExpander;
 import sun.security.util.Debug;
--- a/src/java.base/share/classes/sun/security/ssl/SSLSocketImpl.java	Mon Sep 28 11:39:13 2015 +0200
+++ b/src/java.base/share/classes/sun/security/ssl/SSLSocketImpl.java	Mon Sep 28 13:39:27 2015 +0100
@@ -42,8 +42,8 @@
 import javax.net.ssl.*;
 import sun.misc.ManagedLocalsThread;
 
-import sun.misc.JavaNetInetAddressAccess;
-import sun.misc.SharedSecrets;
+import jdk.internal.misc.JavaNetInetAddressAccess;
+import jdk.internal.misc.SharedSecrets;
 
 /**
  * Implementation of an SSL socket.  This is a normal connection type
@@ -2094,7 +2094,7 @@
      */
     private static String getOriginalHostname(InetAddress inetAddress) {
         /*
-         * Get the original hostname via sun.misc.SharedSecrets.
+         * Get the original hostname via jdk.internal.misc.SharedSecrets.
          */
         JavaNetInetAddressAccess jna = SharedSecrets.getJavaNetInetAddressAccess();
         String originalHostname = jna.getOriginalHostName(inetAddress);
--- a/src/java.base/share/classes/sun/security/util/Password.java	Mon Sep 28 11:39:13 2015 +0200
+++ b/src/java.base/share/classes/sun/security/util/Password.java	Mon Sep 28 13:39:27 2015 +0100
@@ -29,6 +29,7 @@
 import java.nio.*;
 import java.nio.charset.*;
 import java.util.Arrays;
+import jdk.internal.misc.SharedSecrets;
 
 /**
  * A utility class for reading passwords
@@ -139,7 +140,7 @@
     private static byte[] convertToBytes(char[] pass) {
         if (enc == null) {
             synchronized (Password.class) {
-                enc = sun.misc.SharedSecrets.getJavaIOAccess()
+                enc = SharedSecrets.getJavaIOAccess()
                         .charset()
                         .newEncoder()
                         .onMalformedInput(CodingErrorAction.REPLACE)
--- a/src/java.base/share/classes/sun/text/bidi/BidiBase.java	Mon Sep 28 11:39:13 2015 +0200
+++ b/src/java.base/share/classes/sun/text/bidi/BidiBase.java	Mon Sep 28 13:39:27 2015 +0100
@@ -52,8 +52,8 @@
 import java.text.AttributedCharacterIterator;
 import java.text.Bidi;
 import java.util.Arrays;
-import sun.misc.JavaAWTFontAccess;
-import sun.misc.SharedSecrets;
+import jdk.internal.misc.JavaAWTFontAccess;
+import jdk.internal.misc.SharedSecrets;
 import sun.text.normalizer.UBiDiProps;
 import sun.text.normalizer.UCharacter;
 import sun.text.normalizer.UTF16;
--- a/src/java.base/share/classes/sun/util/logging/PlatformLogger.java	Mon Sep 28 11:39:13 2015 +0200
+++ b/src/java.base/share/classes/sun/util/logging/PlatformLogger.java	Mon Sep 28 13:39:27 2015 +0100
@@ -39,8 +39,8 @@
 import java.util.Arrays;
 import java.util.HashMap;
 import java.util.Map;
-import sun.misc.JavaLangAccess;
-import sun.misc.SharedSecrets;
+import jdk.internal.misc.JavaLangAccess;
+import jdk.internal.misc.SharedSecrets;
 
 /**
  * Platform logger provides an API for the JRE components to log
--- a/src/java.base/unix/classes/java/io/FileDescriptor.java	Mon Sep 28 11:39:13 2015 +0200
+++ b/src/java.base/unix/classes/java/io/FileDescriptor.java	Mon Sep 28 13:39:27 2015 +0100
@@ -27,6 +27,8 @@
 
 import java.util.ArrayList;
 import java.util.List;
+import jdk.internal.misc.JavaIOFileDescriptorAccess;
+import jdk.internal.misc.SharedSecrets;
 
 /**
  * Instances of the file descriptor class serve as an opaque handle
@@ -145,8 +147,8 @@
 
     // Set up JavaIOFileDescriptorAccess in SharedSecrets
     static {
-        sun.misc.SharedSecrets.setJavaIOFileDescriptorAccess(
-            new sun.misc.JavaIOFileDescriptorAccess() {
+        SharedSecrets.setJavaIOFileDescriptorAccess(
+            new JavaIOFileDescriptorAccess() {
                 public void set(FileDescriptor obj, int fd) {
                     obj.fd = fd;
                 }
--- a/src/java.base/unix/classes/java/lang/ProcessImpl.java	Mon Sep 28 11:39:13 2015 +0200
+++ b/src/java.base/unix/classes/java/lang/ProcessImpl.java	Mon Sep 28 13:39:27 2015 +0100
@@ -46,6 +46,8 @@
 import java.security.PrivilegedAction;
 import java.security.PrivilegedActionException;
 import java.security.PrivilegedExceptionAction;
+import jdk.internal.misc.JavaIOFileDescriptorAccess;
+import jdk.internal.misc.SharedSecrets;
 
 /**
  * java.lang.Process subclass in the UNIX environment.
@@ -57,8 +59,8 @@
  * @since   1.5
  */
 final class ProcessImpl extends Process {
-    private static final sun.misc.JavaIOFileDescriptorAccess fdAccess
-        = sun.misc.SharedSecrets.getJavaIOFileDescriptorAccess();
+    private static final JavaIOFileDescriptorAccess fdAccess
+        = SharedSecrets.getJavaIOFileDescriptorAccess();
 
     // Linux platforms support a normal (non-forcible) kill signal.
     static final boolean SUPPORTS_NORMAL_TERMINATION = true;
--- a/src/java.base/unix/classes/sun/nio/fs/UnixChannelFactory.java	Mon Sep 28 11:39:13 2015 +0200
+++ b/src/java.base/unix/classes/sun/nio/fs/UnixChannelFactory.java	Mon Sep 28 13:39:27 2015 +0100
@@ -30,11 +30,11 @@
 import java.io.FileDescriptor;
 import java.util.Set;
 
+import jdk.internal.misc.SharedSecrets;
+import jdk.internal.misc.JavaIOFileDescriptorAccess;
 import sun.nio.ch.FileChannelImpl;
 import sun.nio.ch.ThreadPool;
 import sun.nio.ch.SimpleAsynchronousFileChannelImpl;
-import sun.misc.SharedSecrets;
-import sun.misc.JavaIOFileDescriptorAccess;
 
 import static sun.nio.fs.UnixNativeDispatcher.*;
 import static sun.nio.fs.UnixConstants.*;
--- a/src/java.base/windows/classes/java/io/FileDescriptor.java	Mon Sep 28 11:39:13 2015 +0200
+++ b/src/java.base/windows/classes/java/io/FileDescriptor.java	Mon Sep 28 13:39:27 2015 +0100
@@ -27,6 +27,8 @@
 
 import java.util.ArrayList;
 import java.util.List;
+import jdk.internal.misc.JavaIOFileDescriptorAccess;
+import jdk.internal.misc.SharedSecrets;
 
 /**
  * Instances of the file descriptor class serve as an opaque handle
@@ -70,8 +72,8 @@
 
     // Set up JavaIOFileDescriptorAccess in SharedSecrets
     static {
-        sun.misc.SharedSecrets.setJavaIOFileDescriptorAccess(
-            new sun.misc.JavaIOFileDescriptorAccess() {
+        SharedSecrets.setJavaIOFileDescriptorAccess(
+            new JavaIOFileDescriptorAccess() {
                 public void set(FileDescriptor obj, int fd) {
                     obj.fd = fd;
                 }
--- a/src/java.base/windows/classes/java/lang/ProcessImpl.java	Mon Sep 28 11:39:13 2015 +0200
+++ b/src/java.base/windows/classes/java/lang/ProcessImpl.java	Mon Sep 28 13:39:27 2015 +0100
@@ -42,6 +42,8 @@
 import java.util.concurrent.TimeUnit;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
+import jdk.internal.misc.JavaIOFileDescriptorAccess;
+import jdk.internal.misc.SharedSecrets;
 
 /* This class is for the exclusive use of ProcessBuilder.start() to
  * create new processes.
@@ -51,8 +53,8 @@
  */
 
 final class ProcessImpl extends Process {
-    private static final sun.misc.JavaIOFileDescriptorAccess fdAccess
-        = sun.misc.SharedSecrets.getJavaIOFileDescriptorAccess();
+    private static final JavaIOFileDescriptorAccess fdAccess
+        = SharedSecrets.getJavaIOFileDescriptorAccess();
 
     // Windows platforms support a forcible kill signal.
     static final boolean SUPPORTS_NORMAL_TERMINATION = false;
--- a/src/java.base/windows/classes/java/net/DualStackPlainDatagramSocketImpl.java	Mon Sep 28 11:39:13 2015 +0200
+++ b/src/java.base/windows/classes/java/net/DualStackPlainDatagramSocketImpl.java	Mon Sep 28 13:39:27 2015 +0100
@@ -25,8 +25,8 @@
 package java.net;
 
 import java.io.IOException;
-import sun.misc.SharedSecrets;
-import sun.misc.JavaIOFileDescriptorAccess;
+import jdk.internal.misc.SharedSecrets;
+import jdk.internal.misc.JavaIOFileDescriptorAccess;
 
 /**
  * This class defines the plain DatagramSocketImpl that is used on
--- a/src/java.base/windows/classes/java/net/DualStackPlainSocketImpl.java	Mon Sep 28 11:39:13 2015 +0200
+++ b/src/java.base/windows/classes/java/net/DualStackPlainSocketImpl.java	Mon Sep 28 13:39:27 2015 +0100
@@ -26,8 +26,8 @@
 
 import java.io.IOException;
 import java.io.FileDescriptor;
-import sun.misc.SharedSecrets;
-import sun.misc.JavaIOFileDescriptorAccess;
+import jdk.internal.misc.SharedSecrets;
+import jdk.internal.misc.JavaIOFileDescriptorAccess;
 
 /**
  * This class defines the plain SocketImpl that is used on Windows platforms
--- a/src/java.base/windows/classes/sun/nio/ch/FileDispatcherImpl.java	Mon Sep 28 11:39:13 2015 +0200
+++ b/src/java.base/windows/classes/sun/nio/ch/FileDispatcherImpl.java	Mon Sep 28 13:39:27 2015 +0100
@@ -28,8 +28,8 @@
 import java.io.FileDescriptor;
 import java.io.IOException;
 import java.security.PrivilegedAction;
-import sun.misc.SharedSecrets;
-import sun.misc.JavaIOFileDescriptorAccess;
+import jdk.internal.misc.SharedSecrets;
+import jdk.internal.misc.JavaIOFileDescriptorAccess;
 
 class FileDispatcherImpl extends FileDispatcher {
 
--- a/src/java.base/windows/classes/sun/nio/ch/WindowsAsynchronousFileChannelImpl.java	Mon Sep 28 11:39:13 2015 +0200
+++ b/src/java.base/windows/classes/sun/nio/ch/WindowsAsynchronousFileChannelImpl.java	Mon Sep 28 13:39:27 2015 +0100
@@ -31,8 +31,8 @@
 import java.nio.BufferOverflowException;
 import java.io.IOException;
 import java.io.FileDescriptor;
-import sun.misc.SharedSecrets;
-import sun.misc.JavaIOFileDescriptorAccess;
+import jdk.internal.misc.SharedSecrets;
+import jdk.internal.misc.JavaIOFileDescriptorAccess;
 
 /**
  * Windows implementation of AsynchronousFileChannel using overlapped I/O.
--- a/src/java.base/windows/classes/sun/nio/fs/WindowsChannelFactory.java	Mon Sep 28 11:39:13 2015 +0200
+++ b/src/java.base/windows/classes/sun/nio/fs/WindowsChannelFactory.java	Mon Sep 28 13:39:27 2015 +0100
@@ -36,8 +36,8 @@
 
 import com.sun.nio.file.ExtendedOpenOption;
 
-import sun.misc.JavaIOFileDescriptorAccess;
-import sun.misc.SharedSecrets;
+import jdk.internal.misc.JavaIOFileDescriptorAccess;
+import jdk.internal.misc.SharedSecrets;
 import sun.nio.ch.FileChannelImpl;
 import sun.nio.ch.ThreadPool;
 import sun.nio.ch.WindowsAsynchronousFileChannelImpl;
--- a/src/java.desktop/share/classes/com/sun/beans/decoder/DocumentHandler.java	Mon Sep 28 11:39:13 2015 +0200
+++ b/src/java.desktop/share/classes/com/sun/beans/decoder/DocumentHandler.java	Mon Sep 28 13:39:27 2015 +0100
@@ -50,7 +50,7 @@
 import org.xml.sax.SAXException;
 import org.xml.sax.helpers.DefaultHandler;
 
-import sun.misc.SharedSecrets;
+import jdk.internal.misc.SharedSecrets;
 
 /**
  * The main class to parse JavaBeans XML archive.
--- a/src/java.desktop/share/classes/java/awt/EventQueue.java	Mon Sep 28 11:39:13 2015 +0200
+++ b/src/java.desktop/share/classes/java/awt/EventQueue.java	Mon Sep 28 13:39:27 2015 +0100
@@ -47,8 +47,8 @@
 
 import java.security.AccessControlContext;
 
-import sun.misc.SharedSecrets;
-import sun.misc.JavaSecurityAccess;
+import jdk.internal.misc.SharedSecrets;
+import jdk.internal.misc.JavaSecurityAccess;
 
 /**
  * <code>EventQueue</code> is a platform-independent class
--- a/src/java.desktop/share/classes/java/awt/font/JavaAWTFontAccessImpl.java	Mon Sep 28 11:39:13 2015 +0200
+++ b/src/java.desktop/share/classes/java/awt/font/JavaAWTFontAccessImpl.java	Mon Sep 28 13:39:27 2015 +0100
@@ -26,9 +26,9 @@
 package java.awt.font;
 
 import java.lang.reflect.Field;
-import sun.misc.JavaAWTFontAccess;
+import jdk.internal.misc.JavaAWTFontAccess;
 
-class JavaAWTFontAccessImpl implements sun.misc.JavaAWTFontAccess {
+class JavaAWTFontAccessImpl implements JavaAWTFontAccess {
 
     // java.awt.font.TextAttribute constants
     public Object getTextAttributeConstant(String name) {
--- a/src/java.desktop/share/classes/java/awt/font/NumericShaper.java	Mon Sep 28 11:39:13 2015 +0200
+++ b/src/java.desktop/share/classes/java/awt/font/NumericShaper.java	Mon Sep 28 13:39:27 2015 +0100
@@ -31,7 +31,7 @@
 import java.util.Comparator;
 import java.util.EnumSet;
 import java.util.Set;
-import sun.misc.SharedSecrets;
+import jdk.internal.misc.SharedSecrets;
 
 /**
  * The <code>NumericShaper</code> class is used to convert Latin-1 (European)
--- a/src/java.desktop/share/classes/java/awt/font/TextAttribute.java	Mon Sep 28 11:39:13 2015 +0200
+++ b/src/java.desktop/share/classes/java/awt/font/TextAttribute.java	Mon Sep 28 13:39:27 2015 +0100
@@ -44,7 +44,7 @@
 import java.text.AttributedCharacterIterator.Attribute;
 import java.util.Map;
 import java.util.HashMap;
-import sun.misc.SharedSecrets;
+import jdk.internal.misc.SharedSecrets;
 
 /**
  * The <code>TextAttribute</code> class defines attribute keys and
--- a/src/java.desktop/share/classes/java/beans/Introspector.java	Mon Sep 28 11:39:13 2015 +0200
+++ b/src/java.desktop/share/classes/java/beans/Introspector.java	Mon Sep 28 13:39:27 2015 +0100
@@ -47,9 +47,9 @@
 import java.util.EventObject;
 import java.util.List;
 import java.util.TreeMap;
-import sun.misc.JavaBeansAccess;
 
-import sun.misc.SharedSecrets;
+import jdk.internal.misc.JavaBeansAccess;
+import jdk.internal.misc.SharedSecrets;
 import sun.reflect.misc.ReflectUtil;
 
 /**
--- a/src/java.desktop/share/classes/javax/swing/RepaintManager.java	Mon Sep 28 11:39:13 2015 +0200
+++ b/src/java.desktop/share/classes/javax/swing/RepaintManager.java	Mon Sep 28 13:39:27 2015 +0100
@@ -35,13 +35,13 @@
 import java.util.concurrent.atomic.AtomicInteger;
 import java.applet.*;
 
+import jdk.internal.misc.JavaSecurityAccess;
+import jdk.internal.misc.SharedSecrets;
 import sun.awt.AWTAccessor;
 import sun.awt.AppContext;
 import sun.awt.DisplayChangedListener;
 import sun.awt.SunToolkit;
 import sun.java2d.SunGraphicsEnvironment;
-import sun.misc.JavaSecurityAccess;
-import sun.misc.SharedSecrets;
 import sun.security.action.GetPropertyAction;
 
 import com.sun.java.swing.SwingUtilities3;
--- a/src/java.desktop/share/classes/javax/swing/TransferHandler.java	Mon Sep 28 11:39:13 2015 +0200
+++ b/src/java.desktop/share/classes/javax/swing/TransferHandler.java	Mon Sep 28 13:39:27 2015 +0100
@@ -47,8 +47,8 @@
 
 import java.security.AccessControlContext;
 import java.security.ProtectionDomain;
-import sun.misc.SharedSecrets;
-import sun.misc.JavaSecurityAccess;
+import jdk.internal.misc.SharedSecrets;
+import jdk.internal.misc.JavaSecurityAccess;
 
 import sun.awt.AWTAccessor;
 
--- a/src/java.desktop/share/classes/sun/awt/AppContext.java	Mon Sep 28 11:39:13 2015 +0200
+++ b/src/java.desktop/share/classes/sun/awt/AppContext.java	Mon Sep 28 13:39:27 2015 +0100
@@ -44,6 +44,8 @@
 import java.beans.PropertyChangeListener;
 import java.lang.ref.SoftReference;
 
+import jdk.internal.misc.JavaAWTAccess;
+import jdk.internal.misc.SharedSecrets;
 import sun.misc.ManagedLocalsThread;
 import sun.util.logging.PlatformLogger;
 import java.util.concurrent.locks.Condition;
@@ -839,7 +841,7 @@
 
     // Set up JavaAWTAccess in SharedSecrets
     static {
-        sun.misc.SharedSecrets.setJavaAWTAccess(new sun.misc.JavaAWTAccess() {
+        SharedSecrets.setJavaAWTAccess(new JavaAWTAccess() {
             private boolean hasRootThreadGroup(final AppContext ecx) {
                 return AccessController.doPrivileged(new PrivilegedAction<Boolean>() {
                     @Override
@@ -878,13 +880,13 @@
                 // the window of opportunity in which that issue could
                 // happen.
                 if (numAppContexts.get() > 0) {
-                   // Defaults to thread group caching.
-                   // This is probably not required as we only really need
-                   // isolation in a deployed applet environment, in which
-                   // case ecx will not be null when we reach here
-                   // However it helps emulate the deployed environment,
-                   // in tests for instance.
-                   ecx = ecx != null ? ecx : getAppContext();
+                    // Defaults to thread group caching.
+                    // This is probably not required as we only really need
+                    // isolation in a deployed applet environment, in which
+                    // case ecx will not be null when we reach here
+                    // However it helps emulate the deployed environment,
+                    // in tests for instance.
+                    ecx = ecx != null ? ecx : getAppContext();
                 }
 
                 // getAppletContext() may be called when initializing the main
@@ -895,8 +897,8 @@
                 // the root TG as its thread group.
                 // See: JDK-8023258
                 final boolean isMainAppContext = ecx == null
-                    || mainAppContext == ecx
-                    || mainAppContext == null && hasRootThreadGroup(ecx);
+                        || mainAppContext == ecx
+                        || mainAppContext == null && hasRootThreadGroup(ecx);
 
                 return isMainAppContext ? null : ecx;
             }
--- a/src/java.logging/share/classes/java/util/logging/LogManager.java	Mon Sep 28 11:39:13 2015 +0200
+++ b/src/java.logging/share/classes/java/util/logging/LogManager.java	Mon Sep 28 13:39:27 2015 +0100
@@ -34,9 +34,9 @@
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.CopyOnWriteArrayList;
 import java.util.concurrent.locks.ReentrantLock;
-import sun.misc.JavaAWTAccess;
+import jdk.internal.misc.JavaAWTAccess;
+import jdk.internal.misc.SharedSecrets;
 import sun.misc.ManagedLocalsThread;
-import sun.misc.SharedSecrets;
 
 /**
  * There is a single global LogManager object that is used to
--- a/src/java.logging/share/classes/java/util/logging/LogRecord.java	Mon Sep 28 11:39:13 2015 +0200
+++ b/src/java.logging/share/classes/java/util/logging/LogRecord.java	Mon Sep 28 13:39:27 2015 +0100
@@ -31,8 +31,8 @@
 import java.io.*;
 import java.time.Clock;
 
-import sun.misc.JavaLangAccess;
-import sun.misc.SharedSecrets;
+import jdk.internal.misc.JavaLangAccess;
+import jdk.internal.misc.SharedSecrets;
 
 /**
  * LogRecord objects are used to pass logging requests between
--- a/src/java.management/share/classes/com/sun/jmx/mbeanserver/Introspector.java	Mon Sep 28 11:39:13 2015 +0200
+++ b/src/java.management/share/classes/com/sun/jmx/mbeanserver/Introspector.java	Mon Sep 28 13:39:27 2015 +0100
@@ -56,8 +56,6 @@
 import javax.management.AttributeNotFoundException;
 import javax.management.openmbean.CompositeData;
 
-import sun.misc.JavaBeansAccess;
-import sun.misc.SharedSecrets;
 import sun.reflect.misc.MethodUtil;
 import sun.reflect.misc.ReflectUtil;
 
--- a/src/java.management/share/classes/com/sun/jmx/mbeanserver/JavaBeansAccessor.java	Mon Sep 28 11:39:13 2015 +0200
+++ b/src/java.management/share/classes/com/sun/jmx/mbeanserver/JavaBeansAccessor.java	Mon Sep 28 13:39:27 2015 +0100
@@ -26,8 +26,8 @@
 
 import java.lang.reflect.Constructor;
 import java.lang.reflect.Method;
-import sun.misc.JavaBeansAccess;
-import sun.misc.SharedSecrets;
+import jdk.internal.misc.JavaBeansAccess;
+import jdk.internal.misc.SharedSecrets;
 
 /**
  * A centralized place for gaining access to java.beans related functionality -
--- a/src/java.management/share/classes/javax/management/modelmbean/RequiredModelMBean.java	Mon Sep 28 11:39:13 2015 +0200
+++ b/src/java.management/share/classes/javax/management/modelmbean/RequiredModelMBean.java	Mon Sep 28 13:39:27 2015 +0100
@@ -80,8 +80,8 @@
 import javax.management.RuntimeOperationsException;
 import javax.management.ServiceNotFoundException;
 import javax.management.loading.ClassLoaderRepository;
-import sun.misc.JavaSecurityAccess;
-import sun.misc.SharedSecrets;
+import jdk.internal.misc.JavaSecurityAccess;
+import jdk.internal.misc.SharedSecrets;
 
 import sun.reflect.misc.MethodUtil;
 import sun.reflect.misc.ReflectUtil;
--- a/src/java.management/share/classes/sun/management/ManagementFactoryHelper.java	Mon Sep 28 11:39:13 2015 +0200
+++ b/src/java.management/share/classes/sun/management/ManagementFactoryHelper.java	Mon Sep 28 13:39:27 2015 +0100
@@ -36,6 +36,9 @@
 import java.security.AccessController;
 import java.security.PrivilegedActionException;
 import java.security.PrivilegedExceptionAction;
+
+import jdk.internal.misc.JavaNioAccess;
+import jdk.internal.misc.SharedSecrets;
 import sun.util.logging.LoggingSupport;
 import java.util.ArrayList;
 import java.util.List;
@@ -208,7 +211,7 @@
     public static synchronized List<BufferPoolMXBean> getBufferPoolMXBeans() {
         if (bufferPools == null) {
             bufferPools = new ArrayList<>(2);
-            bufferPools.add(createBufferPoolMXBean(sun.misc.SharedSecrets.getJavaNioAccess()
+            bufferPools.add(createBufferPoolMXBean(SharedSecrets.getJavaNioAccess()
                 .getDirectBufferPool()));
             bufferPools.add(createBufferPoolMXBean(sun.nio.ch.FileChannelImpl
                 .getMappedBufferPool()));
@@ -222,7 +225,7 @@
      * Creates management interface for the given buffer pool.
      */
     private static BufferPoolMXBean
-        createBufferPoolMXBean(final sun.misc.JavaNioAccess.BufferPool pool)
+        createBufferPoolMXBean(final JavaNioAccess.BufferPool pool)
     {
         return new BufferPoolMXBean() {
             private volatile ObjectName objname;  // created lazily
--- a/src/java.naming/share/classes/com/sun/jndi/ldap/VersionHelper.java	Mon Sep 28 11:39:13 2015 +0200
+++ b/src/java.naming/share/classes/com/sun/jndi/ldap/VersionHelper.java	Mon Sep 28 13:39:27 2015 +0100
@@ -25,7 +25,7 @@
 
 package com.sun.jndi.ldap;
 
-import sun.misc.SharedSecrets;
+import jdk.internal.misc.SharedSecrets;
 
 import java.net.MalformedURLException;
 import java.net.URL;
--- a/src/java.sql/share/classes/java/sql/Date.java	Mon Sep 28 11:39:13 2015 +0200
+++ b/src/java.sql/share/classes/java/sql/Date.java	Mon Sep 28 13:39:27 2015 +0100
@@ -27,8 +27,8 @@
 
 import java.time.Instant;
 import java.time.LocalDate;
-import sun.misc.SharedSecrets;
-import sun.misc.JavaLangAccess;
+import jdk.internal.misc.SharedSecrets;
+import jdk.internal.misc.JavaLangAccess;
 
 /**
  * <P>A thin wrapper around a millisecond value that allows
--- a/src/java.sql/share/classes/java/sql/Time.java	Mon Sep 28 11:39:13 2015 +0200
+++ b/src/java.sql/share/classes/java/sql/Time.java	Mon Sep 28 13:39:27 2015 +0100
@@ -27,8 +27,8 @@
 
 import java.time.Instant;
 import java.time.LocalTime;
-import sun.misc.SharedSecrets;
-import sun.misc.JavaLangAccess;
+import jdk.internal.misc.SharedSecrets;
+import jdk.internal.misc.JavaLangAccess;
 
 /**
  * <P>A thin wrapper around the <code>java.util.Date</code> class that allows the JDBC
--- a/src/java.sql/share/classes/java/sql/Timestamp.java	Mon Sep 28 11:39:13 2015 +0200
+++ b/src/java.sql/share/classes/java/sql/Timestamp.java	Mon Sep 28 13:39:27 2015 +0100
@@ -27,8 +27,8 @@
 
 import java.time.Instant;
 import java.time.LocalDateTime;
-import sun.misc.SharedSecrets;
-import sun.misc.JavaLangAccess;
+import jdk.internal.misc.SharedSecrets;
+import jdk.internal.misc.JavaLangAccess;
 
 /**
  * <P>A thin wrapper around {@code java.util.Date} that allows
--- a/test/java/security/ProtectionDomain/PreserveCombinerTest.java	Mon Sep 28 11:39:13 2015 +0200
+++ b/test/java/security/ProtectionDomain/PreserveCombinerTest.java	Mon Sep 28 13:39:27 2015 +0100
@@ -26,7 +26,7 @@
 import java.security.DomainCombiner;
 import java.security.PrivilegedAction;
 import java.security.ProtectionDomain;
-import sun.misc.SharedSecrets;
+import jdk.internal.misc.SharedSecrets;
 
 /*
  * @test
@@ -34,7 +34,7 @@
  * @summary Make sure that JavaSecurityAccess.doIntersectionPrivilege()
  *          is not dropping the information about the domain combiner of
  *          the stack ACC
- * @modules java.base/sun.misc
+ * @modules java.base/jdk.internal.misc
  */
 
 public class PreserveCombinerTest {
--- a/test/java/util/logging/LogManagerAppContextDeadlock.java	Mon Sep 28 11:39:13 2015 +0200
+++ b/test/java/util/logging/LogManagerAppContextDeadlock.java	Mon Sep 28 13:39:27 2015 +0100
@@ -35,13 +35,15 @@
 import java.util.concurrent.atomic.AtomicInteger;
 import java.util.logging.LogManager;
 import java.util.logging.Logger;
+import jdk.internal.misc.JavaAWTAccess;
+import jdk.internal.misc.SharedSecrets;
 
 /**
  * @test
  * @bug 8065991
  * @summary check that when LogManager is initialized, a deadlock similar
  *          to that described in 8065709 will not occur.
- * @modules java.base/sun.misc
+ * @modules java.base/jdk.internal.misc
  * @run main/othervm LogManagerAppContextDeadlock UNSECURE
  * @run main/othervm LogManagerAppContextDeadlock SECURE
  *
@@ -97,7 +99,7 @@
         }
 
         static {
-            sun.misc.SharedSecrets.setJavaAWTAccess(new sun.misc.JavaAWTAccess() {
+            SharedSecrets.setJavaAWTAccess(new JavaAWTAccess() {
                 @Override
                 public Object getAppletContext() {
                     if (numAppContexts.get() == 0) return null;
@@ -341,7 +343,7 @@
             // FileHandlers because we're passing invalid parameters
             // which will make the creation fail...
             permissions = new Permissions();
-            permissions.add(new RuntimePermission("accessClassInPackage.sun.misc"));
+            permissions.add(new RuntimePermission("accessClassInPackage.jdk.internal.misc"));
 
             // these are used for configuring the test itself...
             allPermissions = new Permissions();
--- a/test/java/util/logging/RootLogger/RootLevelInConfigFile.java	Mon Sep 28 11:39:13 2015 +0200
+++ b/test/java/util/logging/RootLogger/RootLevelInConfigFile.java	Mon Sep 28 13:39:27 2015 +0100
@@ -34,15 +34,15 @@
 import java.util.logging.LogManager;
 import java.util.logging.Logger;
 import java.util.logging.LoggingPermission;
-import sun.misc.JavaAWTAccess;
-import sun.misc.SharedSecrets;
+import jdk.internal.misc.JavaAWTAccess;
+import jdk.internal.misc.SharedSecrets;
 
 /**
  * @test
  * @bug 8030850
  * @summary Tests that setting .level=FINEST for the root logger in logging
  *      configuration file does work.
- * @modules java.base/sun.misc
+ * @modules java.base/jdk.internal.misc
  * @run main/othervm RootLevelInConfigFile
  *
  * @author danielfuchs
@@ -181,7 +181,7 @@
             perms.add(new PropertyPermission("java.util.logging.config.class","read"));
             perms.add(new PropertyPermission("java.util.logging.config.file","read"));
             perms.add(new FilePermission(configFile, "read"));
-            perms.add(new RuntimePermission("accessClassInPackage.sun.misc"));
+            perms.add(new RuntimePermission("accessClassInPackage.jdk.internal.misc"));
         }
 
         @Override
--- a/test/java/util/logging/TestAppletLoggerContext.java	Mon Sep 28 11:39:13 2015 +0200
+++ b/test/java/util/logging/TestAppletLoggerContext.java	Mon Sep 28 13:39:27 2015 +0100
@@ -33,8 +33,8 @@
 import java.util.logging.LogManager;
 import java.util.logging.Logger;
 import java.util.logging.LoggingPermission;
-import sun.misc.JavaAWTAccess;
-import sun.misc.SharedSecrets;
+import jdk.internal.misc.JavaAWTAccess;
+import jdk.internal.misc.SharedSecrets;
 
 /*
  * @test
@@ -42,7 +42,7 @@
  * @summary  NPE when using Logger.getAnonymousLogger or
  *           LogManager.getLogManager().getLogger
  *
- * @modules java.base/sun.misc
+ * @modules java.base/jdk.internal.misc
  * @run main/othervm -Dtest.security=off TestAppletLoggerContext LoadingApplet
  * @run main/othervm -Dtest.security=on TestAppletLoggerContext  LoadingApplet
  * @run main/othervm -Dtest.security=off TestAppletLoggerContext LoadingMain
--- a/test/java/util/logging/TestGetLoggerNPE.java	Mon Sep 28 11:39:13 2015 +0200
+++ b/test/java/util/logging/TestGetLoggerNPE.java	Mon Sep 28 13:39:27 2015 +0100
@@ -26,8 +26,8 @@
 import java.security.ProtectionDomain;
 import java.util.logging.LogManager;
 import java.util.logging.Logger;
-import sun.misc.JavaAWTAccess;
-import sun.misc.SharedSecrets;
+import jdk.internal.misc.JavaAWTAccess;
+import jdk.internal.misc.SharedSecrets;
 
 /*
  * @test
@@ -35,7 +35,7 @@
  *
  * @summary NPE with logging while launching webstart
  *
- * @modules java.base/sun.misc
+ * @modules java.base/jdk.internal.misc
  * @build TestGetLoggerNPE
  * @run main/othervm TestGetLoggerNPE getLogger
  * @run main/othervm TestGetLoggerNPE getLogManager
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/internal/misc/JavaLangAccess/FormatUnsigned.java	Mon Sep 28 13:39:27 2015 +0100
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2012, 2014, 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.
+ *
+ * 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.
+ */
+
+import jdk.internal.misc.JavaLangAccess;
+import jdk.internal.misc.SharedSecrets;
+
+/*
+ * @test
+ * @bug 8050114
+ * @summary Test JavaLangAccess.formatUnsignedInt/-Long
+ * @modules java.base/jdk.internal.misc
+ */
+public class FormatUnsigned {
+
+    static final JavaLangAccess jla = SharedSecrets.getJavaLangAccess();
+
+    public static void testFormatUnsignedInt() {
+        testFormatUnsignedInt("7fffffff", Integer.MAX_VALUE, 8, 4, 0, 8);
+        testFormatUnsignedInt("80000000", Integer.MIN_VALUE, 8, 4, 0, 8);
+        testFormatUnsignedInt("4711", 04711, 4, 3, 0, 4);
+        testFormatUnsignedInt("4711", 0x4711, 4, 4, 0, 4);
+        testFormatUnsignedInt("1010", 0b1010, 4, 1, 0, 4);
+        testFormatUnsignedInt("00001010", 0b1010, 8, 1, 0, 8);
+        testFormatUnsignedInt("\u0000\u000000001010", 0b1010, 10, 1, 2, 8);
+    }
+
+    public static void testFormatUnsignedLong() {
+        testFormatUnsignedLong("7fffffffffffffff", Long.MAX_VALUE, 16, 4, 0, 16);
+        testFormatUnsignedLong("8000000000000000", Long.MIN_VALUE, 16, 4, 0, 16);
+        testFormatUnsignedLong("4711", 04711L, 4, 3, 0, 4);
+        testFormatUnsignedLong("4711", 0x4711L, 4, 4, 0, 4);
+        testFormatUnsignedLong("1010", 0b1010L, 4, 1, 0, 4);
+        testFormatUnsignedLong("00001010", 0b1010L, 8, 1, 0, 8);
+        testFormatUnsignedLong("\u0000\u000000001010", 0b1010L, 10, 1, 2, 8);
+    }
+
+    public static void testFormatUnsignedInt(String expected, int value, int arraySize, int shift, int offset, int length) {
+        char[] chars = new char[arraySize];
+        jla.formatUnsignedInt(value, shift, chars, offset, length);
+        String s = new String(chars);
+        if (!expected.equals(s)) {
+            throw new Error(s + " should be equal to expected " + expected);
+        }
+    }
+
+    public static void testFormatUnsignedLong(String expected, long value, int arraySize, int shift, int offset, int length) {
+        char[] chars = new char[arraySize];
+        jla.formatUnsignedLong(value, shift, chars, offset, length);
+        String s = new String(chars);
+        if (!expected.equals(s)) {
+            throw new Error(s + " should be equal to expected " + expected);
+        }
+    }
+
+    public static void main(String[] args) {
+        testFormatUnsignedInt();
+        testFormatUnsignedLong();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/internal/misc/JavaLangAccess/NewUnsafeString.java	Mon Sep 28 13:39:27 2015 +0100
@@ -0,0 +1,87 @@
+/*
+ * Copyright (c) 2012, 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.
+ *
+ * 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.
+ */
+
+import java.util.Objects;
+import java.util.Comparator;
+import jdk.internal.misc.JavaLangAccess;
+import jdk.internal.misc.SharedSecrets;
+
+/*
+ * @test
+ * @bug 8013528
+ * @summary Test JavaLangAccess.newUnsafeString
+ * @modules java.base/jdk.internal.misc
+ * @compile -XDignore.symbol.file NewUnsafeString.java
+ */
+public class NewUnsafeString {
+
+    static final JavaLangAccess jla = SharedSecrets.getJavaLangAccess();
+
+    public static void testNewUnsafeString() {
+        String benchmark = "exemplar";
+        String constructorCopy = new String(benchmark);
+        char[] jlaChars = benchmark.toCharArray();
+        String jlaCopy = jla.newStringUnsafe(jlaChars);
+
+        if (benchmark == constructorCopy) {
+            throw new Error("should be different instances");
+        }
+        if (!benchmark.equals(constructorCopy)) {
+            throw new Error("Copy not equal");
+        }
+        if (0 != Objects.compare(benchmark, constructorCopy, Comparator.naturalOrder())) {
+            throw new Error("Copy not equal");
+        }
+
+        if (benchmark == jlaCopy) {
+            throw new Error("should be different instances");
+        }
+        if (!benchmark.equals(jlaCopy)) {
+            throw new Error("Copy not equal");
+        }
+        if (0 != Objects.compare(benchmark, jlaCopy, Comparator.naturalOrder())) {
+            throw new Error("Copy not equal");
+        }
+
+        if (constructorCopy == jlaCopy) {
+            throw new Error("should be different instances");
+        }
+        if (!constructorCopy.equals(jlaCopy)) {
+            throw new Error("Copy not equal");
+        }
+        if (0 != Objects.compare(constructorCopy, jlaCopy, Comparator.naturalOrder())) {
+            throw new Error("Copy not equal");
+        }
+
+        // The following is extremely "evil". Never ever do this in non-test code.
+        jlaChars[0] = 'X';
+        if (!"Xxemplar".equals(jlaCopy)) {
+            throw new Error("jla.newStringUnsafe did not use provided string");
+        }
+
+    }
+
+    public static void main(String[] args) {
+        testNewUnsafeString();
+    }
+}
--- a/test/sun/misc/JavaLangAccess/FormatUnsigned.java	Mon Sep 28 11:39:13 2015 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,79 +0,0 @@
-/*
- * Copyright (c) 2012, 2014, 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.
- *
- * 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.
- */
-
-import sun.misc.JavaLangAccess;
-import sun.misc.SharedSecrets;
-
-/*
- * @test
- * @bug 8050114
- * @summary Test JavaLangAccess.formatUnsignedInt/-Long
- * @modules java.base/sun.misc
- */
-public class FormatUnsigned {
-
-    static final JavaLangAccess jla = SharedSecrets.getJavaLangAccess();
-
-    public static void testFormatUnsignedInt() {
-        testFormatUnsignedInt("7fffffff", Integer.MAX_VALUE, 8, 4, 0, 8);
-        testFormatUnsignedInt("80000000", Integer.MIN_VALUE, 8, 4, 0, 8);
-        testFormatUnsignedInt("4711", 04711, 4, 3, 0, 4);
-        testFormatUnsignedInt("4711", 0x4711, 4, 4, 0, 4);
-        testFormatUnsignedInt("1010", 0b1010, 4, 1, 0, 4);
-        testFormatUnsignedInt("00001010", 0b1010, 8, 1, 0, 8);
-        testFormatUnsignedInt("\u0000\u000000001010", 0b1010, 10, 1, 2, 8);
-    }
-
-    public static void testFormatUnsignedLong() {
-        testFormatUnsignedLong("7fffffffffffffff", Long.MAX_VALUE, 16, 4, 0, 16);
-        testFormatUnsignedLong("8000000000000000", Long.MIN_VALUE, 16, 4, 0, 16);
-        testFormatUnsignedLong("4711", 04711L, 4, 3, 0, 4);
-        testFormatUnsignedLong("4711", 0x4711L, 4, 4, 0, 4);
-        testFormatUnsignedLong("1010", 0b1010L, 4, 1, 0, 4);
-        testFormatUnsignedLong("00001010", 0b1010L, 8, 1, 0, 8);
-        testFormatUnsignedLong("\u0000\u000000001010", 0b1010L, 10, 1, 2, 8);
-    }
-
-    public static void testFormatUnsignedInt(String expected, int value, int arraySize, int shift, int offset, int length) {
-        char[] chars = new char[arraySize];
-        jla.formatUnsignedInt(value, shift, chars, offset, length);
-        String s = new String(chars);
-        if (!expected.equals(s)) {
-            throw new Error(s + " should be equal to expected " + expected);
-        }
-    }
-
-    public static void testFormatUnsignedLong(String expected, long value, int arraySize, int shift, int offset, int length) {
-        char[] chars = new char[arraySize];
-        jla.formatUnsignedLong(value, shift, chars, offset, length);
-        String s = new String(chars);
-        if (!expected.equals(s)) {
-            throw new Error(s + " should be equal to expected " + expected);
-        }
-    }
-
-    public static void main(String[] args) {
-        testFormatUnsignedInt();
-        testFormatUnsignedLong();
-    }
-}
--- a/test/sun/misc/JavaLangAccess/NewUnsafeString.java	Mon Sep 28 11:39:13 2015 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,87 +0,0 @@
-/*
- * Copyright (c) 2012, 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.
- *
- * 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.
- */
-
-import java.util.Objects;
-import java.util.Comparator;
-import sun.misc.JavaLangAccess;
-import sun.misc.SharedSecrets;
-
-/*
- * @test
- * @bug 8013528
- * @summary Test JavaLangAccess.newUnsafeString
- * @modules java.base/sun.misc
- * @compile -XDignore.symbol.file NewUnsafeString.java
- */
-public class NewUnsafeString {
-
-    static final JavaLangAccess jla = SharedSecrets.getJavaLangAccess();
-
-    public static void testNewUnsafeString() {
-        String benchmark = "exemplar";
-        String constructorCopy = new String(benchmark);
-        char[] jlaChars = benchmark.toCharArray();
-        String jlaCopy = jla.newStringUnsafe(jlaChars);
-
-        if (benchmark == constructorCopy) {
-            throw new Error("should be different instances");
-        }
-        if (!benchmark.equals(constructorCopy)) {
-            throw new Error("Copy not equal");
-        }
-        if (0 != Objects.compare(benchmark, constructorCopy, Comparator.naturalOrder())) {
-            throw new Error("Copy not equal");
-        }
-
-        if (benchmark == jlaCopy) {
-            throw new Error("should be different instances");
-        }
-        if (!benchmark.equals(jlaCopy)) {
-            throw new Error("Copy not equal");
-        }
-        if (0 != Objects.compare(benchmark, jlaCopy, Comparator.naturalOrder())) {
-            throw new Error("Copy not equal");
-        }
-
-        if (constructorCopy == jlaCopy) {
-            throw new Error("should be different instances");
-        }
-        if (!constructorCopy.equals(jlaCopy)) {
-            throw new Error("Copy not equal");
-        }
-        if (0 != Objects.compare(constructorCopy, jlaCopy, Comparator.naturalOrder())) {
-            throw new Error("Copy not equal");
-        }
-
-        // The following is extremely "evil". Never ever do this in non-test code.
-        jlaChars[0] = 'X';
-        if (!"Xxemplar".equals(jlaCopy)) {
-            throw new Error("jla.newStringUnsafe did not use provided string");
-        }
-
-    }
-
-    public static void main(String[] args) {
-        testNewUnsafeString();
-    }
-}