--- old/src/java.base/share/classes/com/sun/crypto/provider/SealedObjectForKeyProtector.java 2018-11-01 19:06:32.000000000 -0700 +++ new/src/java.base/share/classes/com/sun/crypto/provider/SealedObjectForKeyProtector.java 2018-11-01 19:06:31.000000000 -0700 @@ -25,7 +25,7 @@ package com.sun.crypto.provider; -import jdk.internal.misc.SharedSecrets; +import jdk.internal.access.SharedSecrets; import java.io.*; import java.security.*; --- old/src/java.base/share/classes/java/io/Console.java 2018-11-01 19:06:34.000000000 -0700 +++ new/src/java.base/share/classes/java/io/Console.java 2018-11-01 19:06:33.000000000 -0700 @@ -27,8 +27,8 @@ import java.util.*; import java.nio.charset.Charset; -import jdk.internal.misc.JavaIOAccess; -import jdk.internal.misc.SharedSecrets; +import jdk.internal.access.JavaIOAccess; +import jdk.internal.access.SharedSecrets; import sun.nio.cs.StreamDecoder; import sun.nio.cs.StreamEncoder; --- old/src/java.base/share/classes/java/io/DeleteOnExitHook.java 2018-11-01 19:06:36.000000000 -0700 +++ new/src/java.base/share/classes/java/io/DeleteOnExitHook.java 2018-11-01 19:06:35.000000000 -0700 @@ -25,8 +25,8 @@ package java.io; import java.util.*; -import java.io.File; -import jdk.internal.misc.SharedSecrets; + +import jdk.internal.access.SharedSecrets; /** * This class holds a set of filenames to be deleted on VM exit through a shutdown hook. --- old/src/java.base/share/classes/java/io/FileCleanable.java 2018-11-01 19:06:38.000000000 -0700 +++ new/src/java.base/share/classes/java/io/FileCleanable.java 2018-11-01 19:06:37.000000000 -0700 @@ -25,8 +25,8 @@ package java.io; -import jdk.internal.misc.JavaIOFileDescriptorAccess; -import jdk.internal.misc.SharedSecrets; +import jdk.internal.access.JavaIOFileDescriptorAccess; +import jdk.internal.access.SharedSecrets; import jdk.internal.ref.CleanerFactory; import jdk.internal.ref.PhantomCleanable; --- old/src/java.base/share/classes/java/io/FileDescriptor.java 2018-11-01 19:06:40.000000000 -0700 +++ new/src/java.base/share/classes/java/io/FileDescriptor.java 2018-11-01 19:06:39.000000000 -0700 @@ -29,8 +29,8 @@ import java.util.List; import java.util.Objects; -import jdk.internal.misc.JavaIOFileDescriptorAccess; -import jdk.internal.misc.SharedSecrets; +import jdk.internal.access.JavaIOFileDescriptorAccess; +import jdk.internal.access.SharedSecrets; import jdk.internal.ref.PhantomCleanable; /** --- old/src/java.base/share/classes/java/io/FileOutputStream.java 2018-11-01 19:06:41.000000000 -0700 +++ new/src/java.base/share/classes/java/io/FileOutputStream.java 2018-11-01 19:06:41.000000000 -0700 @@ -26,8 +26,8 @@ package java.io; import java.nio.channels.FileChannel; -import jdk.internal.misc.SharedSecrets; -import jdk.internal.misc.JavaIOFileDescriptorAccess; +import jdk.internal.access.SharedSecrets; +import jdk.internal.access.JavaIOFileDescriptorAccess; import sun.nio.ch.FileChannelImpl; --- old/src/java.base/share/classes/java/io/FilePermission.java 2018-11-01 19:06:43.000000000 -0700 +++ new/src/java.base/share/classes/java/io/FilePermission.java 2018-11-01 19:06:42.000000000 -0700 @@ -34,8 +34,8 @@ import java.util.Vector; import java.util.concurrent.ConcurrentHashMap; -import jdk.internal.misc.JavaIOFilePermissionAccess; -import jdk.internal.misc.SharedSecrets; +import jdk.internal.access.JavaIOFilePermissionAccess; +import jdk.internal.access.SharedSecrets; import sun.nio.fs.DefaultFileSystemProvider; import sun.security.action.GetPropertyAction; import sun.security.util.FilePermCompat; --- old/src/java.base/share/classes/java/io/ObjectInputFilter.java 2018-11-01 19:06:47.000000000 -0700 +++ new/src/java.base/share/classes/java/io/ObjectInputFilter.java 2018-11-01 19:06:46.000000000 -0700 @@ -34,7 +34,7 @@ import java.util.Optional; import java.util.function.Function; -import jdk.internal.misc.SharedSecrets; +import jdk.internal.access.SharedSecrets; /** * Filter classes, array lengths, and graph metrics during deserialization. --- old/src/java.base/share/classes/java/io/ObjectInputStream.java 2018-11-01 19:06:49.000000000 -0700 +++ new/src/java.base/share/classes/java/io/ObjectInputStream.java 2018-11-01 19:06:48.000000000 -0700 @@ -44,7 +44,7 @@ import static java.io.ObjectStreamClass.processQueue; -import jdk.internal.misc.SharedSecrets; +import jdk.internal.access.SharedSecrets; import jdk.internal.misc.Unsafe; import sun.reflect.misc.ReflectUtil; --- old/src/java.base/share/classes/java/io/ObjectStreamClass.java 2018-11-01 19:06:52.000000000 -0700 +++ new/src/java.base/share/classes/java/io/ObjectStreamClass.java 2018-11-01 19:06:51.000000000 -0700 @@ -57,9 +57,9 @@ import jdk.internal.reflect.CallerSensitive; import jdk.internal.reflect.Reflection; import jdk.internal.reflect.ReflectionFactory; +import jdk.internal.access.SharedSecrets; +import jdk.internal.access.JavaSecurityAccess; import sun.reflect.misc.ReflectUtil; -import jdk.internal.misc.SharedSecrets; -import jdk.internal.misc.JavaSecurityAccess; import static java.io.ObjectStreamField.*; /** --- old/src/java.base/share/classes/java/io/RandomAccessFile.java 2018-11-01 19:06:54.000000000 -0700 +++ new/src/java.base/share/classes/java/io/RandomAccessFile.java 2018-11-01 19:06:53.000000000 -0700 @@ -26,9 +26,9 @@ package java.io; import java.nio.channels.FileChannel; -import java.util.concurrent.atomic.AtomicBoolean; -import jdk.internal.misc.JavaIORandomAccessFileAccess; -import jdk.internal.misc.SharedSecrets; + +import jdk.internal.access.JavaIORandomAccessFileAccess; +import jdk.internal.access.SharedSecrets; import sun.nio.ch.FileChannelImpl; --- old/src/java.base/share/classes/java/lang/Runtime.java 2018-11-01 19:06:56.000000000 -0700 +++ new/src/java.base/share/classes/java/lang/Runtime.java 2018-11-01 19:06:55.000000000 -0700 @@ -27,16 +27,14 @@ import java.io.*; import java.math.BigInteger; -import java.util.ArrayList; import java.util.regex.Matcher; import java.util.regex.Pattern; import java.util.stream.Collectors; -import java.util.Collections; import java.util.List; import java.util.Optional; import java.util.StringTokenizer; -import jdk.internal.misc.SharedSecrets; +import jdk.internal.access.SharedSecrets; import jdk.internal.reflect.CallerSensitive; import jdk.internal.reflect.Reflection; --- old/src/java.base/share/classes/java/lang/StackFrameInfo.java 2018-11-01 19:06:58.000000000 -0700 +++ new/src/java.base/share/classes/java/lang/StackFrameInfo.java 2018-11-01 19:06:57.000000000 -0700 @@ -24,10 +24,9 @@ */ package java.lang; -import jdk.internal.misc.JavaLangInvokeAccess; -import jdk.internal.misc.SharedSecrets; +import jdk.internal.access.JavaLangInvokeAccess; +import jdk.internal.access.SharedSecrets; -import static java.lang.StackWalker.Option.*; import java.lang.StackWalker.StackFrame; import java.lang.invoke.MethodType; --- old/src/java.base/share/classes/java/lang/System.java 2018-11-01 19:06:59.000000000 -0700 +++ new/src/java.base/share/classes/java/lang/System.java 2018-11-01 19:06:59.000000000 -0700 @@ -66,8 +66,8 @@ import jdk.internal.reflect.CallerSensitive; import jdk.internal.reflect.Reflection; import jdk.internal.HotSpotIntrinsicCandidate; -import jdk.internal.misc.JavaLangAccess; -import jdk.internal.misc.SharedSecrets; +import jdk.internal.access.JavaLangAccess; +import jdk.internal.access.SharedSecrets; import jdk.internal.misc.VM; import jdk.internal.logger.LoggerFinderLoader; import jdk.internal.logger.LazyLoggers; --- old/src/java.base/share/classes/java/lang/Thread.java 2018-11-01 19:07:01.000000000 -0700 +++ new/src/java.base/share/classes/java/lang/Thread.java 2018-11-01 19:07:00.000000000 -0700 @@ -230,7 +230,7 @@ private volatile Interruptible blocker; private final Object blockerLock = new Object(); - /* Set the blocker field; invoked via jdk.internal.misc.SharedSecrets + /* Set the blocker field; invoked via jdk.internal.access.SharedSecrets * from java.nio code */ static void blockedOn(Interruptible b) { --- old/src/java.base/share/classes/java/lang/invoke/MethodHandleImpl.java 2018-11-01 19:07:02.000000000 -0700 +++ new/src/java.base/share/classes/java/lang/invoke/MethodHandleImpl.java 2018-11-01 19:07:02.000000000 -0700 @@ -25,8 +25,8 @@ package java.lang.invoke; -import jdk.internal.misc.JavaLangInvokeAccess; -import jdk.internal.misc.SharedSecrets; +import jdk.internal.access.JavaLangInvokeAccess; +import jdk.internal.access.SharedSecrets; import jdk.internal.org.objectweb.asm.AnnotationVisitor; import jdk.internal.org.objectweb.asm.ClassWriter; import jdk.internal.org.objectweb.asm.MethodVisitor; --- old/src/java.base/share/classes/java/lang/invoke/MethodHandles.java 2018-11-01 19:07:04.000000000 -0700 +++ new/src/java.base/share/classes/java/lang/invoke/MethodHandles.java 2018-11-01 19:07:03.000000000 -0700 @@ -25,7 +25,7 @@ package java.lang.invoke; -import jdk.internal.misc.SharedSecrets; +import jdk.internal.access.SharedSecrets; import jdk.internal.module.IllegalAccessLogger; import jdk.internal.org.objectweb.asm.ClassReader; import jdk.internal.reflect.CallerSensitive; --- old/src/java.base/share/classes/java/lang/module/ModuleDescriptor.java 2018-11-01 19:07:05.000000000 -0700 +++ new/src/java.base/share/classes/java/lang/module/ModuleDescriptor.java 2018-11-01 19:07:05.000000000 -0700 @@ -2603,8 +2603,8 @@ * Setup the shared secret to allow code in other packages access * private package methods in java.lang.module. */ - jdk.internal.misc.SharedSecrets - .setJavaLangModuleAccess(new jdk.internal.misc.JavaLangModuleAccess() { + jdk.internal.access.SharedSecrets + .setJavaLangModuleAccess(new jdk.internal.access.JavaLangModuleAccess() { @Override public Builder newModuleBuilder(String mn, boolean strict, --- old/src/java.base/share/classes/java/lang/ref/Finalizer.java 2018-11-01 19:07:07.000000000 -0700 +++ new/src/java.base/share/classes/java/lang/ref/Finalizer.java 2018-11-01 19:07:06.000000000 -0700 @@ -27,8 +27,8 @@ import java.security.PrivilegedAction; import java.security.AccessController; -import jdk.internal.misc.JavaLangAccess; -import jdk.internal.misc.SharedSecrets; +import jdk.internal.access.JavaLangAccess; +import jdk.internal.access.SharedSecrets; import jdk.internal.misc.VM; final class Finalizer extends FinalReference { /* Package-private; must be in --- old/src/java.base/share/classes/java/lang/ref/Reference.java 2018-11-01 19:07:08.000000000 -0700 +++ new/src/java.base/share/classes/java/lang/ref/Reference.java 2018-11-01 19:07:08.000000000 -0700 @@ -27,8 +27,8 @@ import jdk.internal.vm.annotation.ForceInline; import jdk.internal.HotSpotIntrinsicCandidate; -import jdk.internal.misc.JavaLangRefAccess; -import jdk.internal.misc.SharedSecrets; +import jdk.internal.access.JavaLangRefAccess; +import jdk.internal.access.SharedSecrets; import jdk.internal.ref.Cleaner; /** --- old/src/java.base/share/classes/java/lang/reflect/Constructor.java 2018-11-01 19:07:10.000000000 -0700 +++ new/src/java.base/share/classes/java/lang/reflect/Constructor.java 2018-11-01 19:07:09.000000000 -0700 @@ -25,7 +25,7 @@ package java.lang.reflect; -import jdk.internal.misc.SharedSecrets; +import jdk.internal.access.SharedSecrets; import jdk.internal.reflect.CallerSensitive; import jdk.internal.reflect.ConstructorAccessor; import jdk.internal.reflect.Reflection; --- old/src/java.base/share/classes/java/lang/reflect/Executable.java 2018-11-01 19:07:11.000000000 -0700 +++ new/src/java.base/share/classes/java/lang/reflect/Executable.java 2018-11-01 19:07:10.000000000 -0700 @@ -30,7 +30,7 @@ import java.util.Objects; import java.util.StringJoiner; -import jdk.internal.misc.SharedSecrets; +import jdk.internal.access.SharedSecrets; import sun.reflect.annotation.AnnotationParser; import sun.reflect.annotation.AnnotationSupport; import sun.reflect.annotation.TypeAnnotationParser; --- old/src/java.base/share/classes/java/lang/reflect/Field.java 2018-11-01 19:07:12.000000000 -0700 +++ new/src/java.base/share/classes/java/lang/reflect/Field.java 2018-11-01 19:07:12.000000000 -0700 @@ -25,7 +25,7 @@ package java.lang.reflect; -import jdk.internal.misc.SharedSecrets; +import jdk.internal.access.SharedSecrets; import jdk.internal.reflect.CallerSensitive; import jdk.internal.reflect.FieldAccessor; import jdk.internal.reflect.Reflection; --- old/src/java.base/share/classes/java/lang/reflect/Method.java 2018-11-01 19:07:14.000000000 -0700 +++ new/src/java.base/share/classes/java/lang/reflect/Method.java 2018-11-01 19:07:13.000000000 -0700 @@ -26,7 +26,7 @@ package java.lang.reflect; import jdk.internal.HotSpotIntrinsicCandidate; -import jdk.internal.misc.SharedSecrets; +import jdk.internal.access.SharedSecrets; import jdk.internal.reflect.CallerSensitive; import jdk.internal.reflect.MethodAccessor; import jdk.internal.reflect.Reflection; --- old/src/java.base/share/classes/java/lang/reflect/Proxy.java 2018-11-01 19:07:15.000000000 -0700 +++ new/src/java.base/share/classes/java/lang/reflect/Proxy.java 2018-11-01 19:07:14.000000000 -0700 @@ -40,9 +40,9 @@ import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicLong; +import jdk.internal.access.JavaLangAccess; +import jdk.internal.access.SharedSecrets; import jdk.internal.loader.BootLoader; -import jdk.internal.misc.JavaLangAccess; -import jdk.internal.misc.SharedSecrets; import jdk.internal.module.Modules; import jdk.internal.misc.VM; import jdk.internal.reflect.CallerSensitive; --- old/src/java.base/share/classes/java/lang/reflect/UndeclaredThrowableException.java 2018-11-01 19:07:16.000000000 -0700 +++ new/src/java.base/share/classes/java/lang/reflect/UndeclaredThrowableException.java 2018-11-01 19:07:16.000000000 -0700 @@ -29,7 +29,7 @@ import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.io.ObjectStreamField; -import jdk.internal.misc.SharedSecrets; +import jdk.internal.access.SharedSecrets; /** * Thrown by a method invocation on a proxy instance if its invocation --- old/src/java.base/share/classes/java/net/HttpCookie.java 2018-11-01 19:07:17.000000000 -0700 +++ new/src/java.base/share/classes/java/net/HttpCookie.java 2018-11-01 19:07:17.000000000 -0700 @@ -32,11 +32,10 @@ import java.util.TimeZone; import java.util.Calendar; import java.util.GregorianCalendar; -import java.util.Date; import java.util.Locale; import java.util.Objects; -import jdk.internal.misc.JavaNetHttpCookieAccess; -import jdk.internal.misc.SharedSecrets; +import jdk.internal.access.JavaNetHttpCookieAccess; +import jdk.internal.access.SharedSecrets; /** * An HttpCookie object represents an HTTP cookie, which carries state --- old/src/java.base/share/classes/java/net/InetAddress.java 2018-11-01 19:07:19.000000000 -0700 +++ new/src/java.base/share/classes/java/net/InetAddress.java 2018-11-01 19:07:18.000000000 -0700 @@ -46,8 +46,8 @@ import java.util.concurrent.ConcurrentSkipListSet; import java.util.concurrent.atomic.AtomicLong; -import jdk.internal.misc.JavaNetInetAddressAccess; -import jdk.internal.misc.SharedSecrets; +import jdk.internal.access.JavaNetInetAddressAccess; +import jdk.internal.access.SharedSecrets; import sun.security.action.*; import sun.net.InetAddressCachePolicy; import sun.net.util.IPAddressUtil; --- old/src/java.base/share/classes/java/net/ServerSocket.java 2018-11-01 19:07:20.000000000 -0700 +++ new/src/java.base/share/classes/java/net/ServerSocket.java 2018-11-01 19:07:19.000000000 -0700 @@ -25,8 +25,8 @@ package java.net; -import jdk.internal.misc.JavaNetSocketAccess; -import jdk.internal.misc.SharedSecrets; +import jdk.internal.access.JavaNetSocketAccess; +import jdk.internal.access.SharedSecrets; import java.io.FileDescriptor; import java.io.IOException; --- old/src/java.base/share/classes/java/net/SocketCleanable.java 2018-11-01 19:07:21.000000000 -0700 +++ new/src/java.base/share/classes/java/net/SocketCleanable.java 2018-11-01 19:07:21.000000000 -0700 @@ -24,8 +24,8 @@ */ package java.net; -import jdk.internal.misc.JavaIOFileDescriptorAccess; -import jdk.internal.misc.SharedSecrets; +import jdk.internal.access.JavaIOFileDescriptorAccess; +import jdk.internal.access.SharedSecrets; import jdk.internal.ref.CleanerFactory; import jdk.internal.ref.PhantomCleanable; --- old/src/java.base/share/classes/java/net/URI.java 2018-11-01 19:07:23.000000000 -0700 +++ new/src/java.base/share/classes/java/net/URI.java 2018-11-01 19:07:22.000000000 -0700 @@ -37,8 +37,8 @@ import java.nio.charset.CodingErrorAction; import java.nio.charset.CharacterCodingException; import java.text.Normalizer; -import jdk.internal.misc.JavaNetUriAccess; -import jdk.internal.misc.SharedSecrets; +import jdk.internal.access.JavaNetUriAccess; +import jdk.internal.access.SharedSecrets; import sun.nio.cs.ThreadLocalCoders; import java.lang.Character; // for javadoc --- old/src/java.base/share/classes/java/net/URL.java 2018-11-01 19:07:24.000000000 -0700 +++ new/src/java.base/share/classes/java/net/URL.java 2018-11-01 19:07:24.000000000 -0700 @@ -41,8 +41,8 @@ import java.util.ServiceConfigurationError; import java.util.ServiceLoader; -import jdk.internal.misc.JavaNetURLAccess; -import jdk.internal.misc.SharedSecrets; +import jdk.internal.access.JavaNetURLAccess; +import jdk.internal.access.SharedSecrets; import sun.security.util.SecurityConstants; import sun.security.action.GetPropertyAction; --- old/src/java.base/share/classes/java/net/URLClassLoader.java 2018-11-01 19:07:25.000000000 -0700 +++ new/src/java.base/share/classes/java/net/URLClassLoader.java 2018-11-01 19:07:25.000000000 -0700 @@ -52,8 +52,8 @@ import jdk.internal.loader.Resource; import jdk.internal.loader.URLClassPath; -import jdk.internal.misc.JavaNetURLClassLoaderAccess; -import jdk.internal.misc.SharedSecrets; +import jdk.internal.access.JavaNetURLClassLoaderAccess; +import jdk.internal.access.SharedSecrets; import jdk.internal.perf.PerfCounter; import sun.net.www.ParseUtil; import sun.security.util.SecurityConstants; --- old/src/java.base/share/classes/java/nio/Bits.java 2018-11-01 19:07:26.000000000 -0700 +++ new/src/java.base/share/classes/java/nio/Bits.java 2018-11-01 19:07:26.000000000 -0700 @@ -25,9 +25,9 @@ package java.nio; -import jdk.internal.misc.JavaLangRefAccess; -import jdk.internal.misc.JavaNioAccess; -import jdk.internal.misc.SharedSecrets; +import jdk.internal.access.JavaLangRefAccess; +import jdk.internal.access.JavaNioAccess; +import jdk.internal.access.SharedSecrets; import jdk.internal.misc.Unsafe; import jdk.internal.misc.VM; --- old/src/java.base/share/classes/java/nio/Buffer.java 2018-11-01 19:07:28.000000000 -0700 +++ new/src/java.base/share/classes/java/nio/Buffer.java 2018-11-01 19:07:27.000000000 -0700 @@ -26,8 +26,8 @@ package java.nio; import jdk.internal.HotSpotIntrinsicCandidate; -import jdk.internal.misc.JavaNioAccess; -import jdk.internal.misc.SharedSecrets; +import jdk.internal.access.JavaNioAccess; +import jdk.internal.access.SharedSecrets; import jdk.internal.misc.Unsafe; import java.util.Spliterator; --- old/src/java.base/share/classes/java/nio/channels/spi/AbstractInterruptibleChannel.java 2018-11-01 19:07:29.000000000 -0700 +++ new/src/java.base/share/classes/java/nio/channels/spi/AbstractInterruptibleChannel.java 2018-11-01 19:07:28.000000000 -0700 @@ -30,7 +30,7 @@ import java.io.IOException; import java.nio.channels.*; -import jdk.internal.misc.SharedSecrets; +import jdk.internal.access.SharedSecrets; import sun.nio.ch.Interruptible; @@ -203,7 +203,7 @@ } - // -- jdk.internal.misc.SharedSecrets -- + // -- jdk.internal.access.SharedSecrets -- static void blockedOn(Interruptible intr) { // package-private SharedSecrets.getJavaLangAccess().blockedOn(intr); } --- old/src/java.base/share/classes/java/nio/file/Files.java 2018-11-01 19:07:30.000000000 -0700 +++ new/src/java.base/share/classes/java/nio/file/Files.java 2018-11-01 19:07:29.000000000 -0700 @@ -3128,8 +3128,8 @@ */ private static final int MAX_BUFFER_SIZE = Integer.MAX_VALUE - 8; - private static final jdk.internal.misc.JavaLangAccess JLA = - jdk.internal.misc.SharedSecrets.getJavaLangAccess(); + private static final jdk.internal.access.JavaLangAccess JLA = + jdk.internal.access.SharedSecrets.getJavaLangAccess(); /** * Reads all the bytes from an input stream. Uses {@code initialSize} as a hint --- old/src/java.base/share/classes/java/security/PrivilegedActionException.java 2018-11-01 19:07:31.000000000 -0700 +++ new/src/java.base/share/classes/java/security/PrivilegedActionException.java 2018-11-01 19:07:31.000000000 -0700 @@ -29,7 +29,7 @@ import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.io.ObjectStreamField; -import jdk.internal.misc.SharedSecrets; +import jdk.internal.access.SharedSecrets; /** * This exception is thrown by --- old/src/java.base/share/classes/java/security/ProtectionDomain.java 2018-11-01 19:07:33.000000000 -0700 +++ new/src/java.base/share/classes/java/security/ProtectionDomain.java 2018-11-01 19:07:32.000000000 -0700 @@ -32,8 +32,8 @@ import java.util.Map; import java.util.Objects; import java.util.WeakHashMap; -import jdk.internal.misc.JavaSecurityAccess; -import jdk.internal.misc.SharedSecrets; +import jdk.internal.access.JavaSecurityAccess; +import jdk.internal.access.SharedSecrets; import sun.security.action.GetPropertyAction; import sun.security.provider.PolicyFile; import sun.security.util.Debug; --- old/src/java.base/share/classes/java/security/Security.java 2018-11-01 19:07:34.000000000 -0700 +++ new/src/java.base/share/classes/java/security/Security.java 2018-11-01 19:07:33.000000000 -0700 @@ -30,7 +30,7 @@ import java.io.*; import java.net.URL; -import jdk.internal.misc.SharedSecrets; +import jdk.internal.access.SharedSecrets; import jdk.internal.util.StaticProperty; import sun.security.util.Debug; import sun.security.util.PropertyExpander; --- old/src/java.base/share/classes/java/util/ArrayDeque.java 2018-11-01 19:07:35.000000000 -0700 +++ new/src/java.base/share/classes/java/util/ArrayDeque.java 2018-11-01 19:07:35.000000000 -0700 @@ -37,8 +37,8 @@ import java.io.Serializable; import java.util.function.Consumer; import java.util.function.Predicate; -import java.util.function.UnaryOperator; -import jdk.internal.misc.SharedSecrets; + +import jdk.internal.access.SharedSecrets; /** * Resizable-array implementation of the {@link Deque} interface. Array --- old/src/java.base/share/classes/java/util/ArrayList.java 2018-11-01 19:07:36.000000000 -0700 +++ new/src/java.base/share/classes/java/util/ArrayList.java 2018-11-01 19:07:36.000000000 -0700 @@ -28,7 +28,7 @@ import java.util.function.Consumer; import java.util.function.Predicate; import java.util.function.UnaryOperator; -import jdk.internal.misc.SharedSecrets; +import jdk.internal.access.SharedSecrets; /** * Resizable-array implementation of the {@code List} interface. Implements --- old/src/java.base/share/classes/java/util/EnumMap.java 2018-11-01 19:07:38.000000000 -0700 +++ new/src/java.base/share/classes/java/util/EnumMap.java 2018-11-01 19:07:37.000000000 -0700 @@ -25,7 +25,7 @@ package java.util; -import jdk.internal.misc.SharedSecrets; +import jdk.internal.access.SharedSecrets; /** * A specialized {@link Map} implementation for use with enum type keys. All --- old/src/java.base/share/classes/java/util/EnumSet.java 2018-11-01 19:07:39.000000000 -0700 +++ new/src/java.base/share/classes/java/util/EnumSet.java 2018-11-01 19:07:38.000000000 -0700 @@ -25,7 +25,7 @@ package java.util; -import jdk.internal.misc.SharedSecrets; +import jdk.internal.access.SharedSecrets; /** * A specialized {@link Set} implementation for use with enum types. All of --- old/src/java.base/share/classes/java/util/HashMap.java 2018-11-01 19:07:40.000000000 -0700 +++ new/src/java.base/share/classes/java/util/HashMap.java 2018-11-01 19:07:40.000000000 -0700 @@ -34,7 +34,7 @@ import java.util.function.BiFunction; import java.util.function.Consumer; import java.util.function.Function; -import jdk.internal.misc.SharedSecrets; +import jdk.internal.access.SharedSecrets; /** * Hash table based implementation of the {@code Map} interface. This --- old/src/java.base/share/classes/java/util/HashSet.java 2018-11-01 19:07:41.000000000 -0700 +++ new/src/java.base/share/classes/java/util/HashSet.java 2018-11-01 19:07:41.000000000 -0700 @@ -26,7 +26,7 @@ package java.util; import java.io.InvalidObjectException; -import jdk.internal.misc.SharedSecrets; +import jdk.internal.access.SharedSecrets; /** * This class implements the {@code Set} interface, backed by a hash table --- old/src/java.base/share/classes/java/util/Hashtable.java 2018-11-01 19:07:43.000000000 -0700 +++ new/src/java.base/share/classes/java/util/Hashtable.java 2018-11-01 19:07:42.000000000 -0700 @@ -29,7 +29,7 @@ import java.util.function.BiConsumer; import java.util.function.Function; import java.util.function.BiFunction; -import jdk.internal.misc.SharedSecrets; +import jdk.internal.access.SharedSecrets; /** * This class implements a hash table, which maps keys to values. Any --- old/src/java.base/share/classes/java/util/IdentityHashMap.java 2018-11-01 19:07:44.000000000 -0700 +++ new/src/java.base/share/classes/java/util/IdentityHashMap.java 2018-11-01 19:07:43.000000000 -0700 @@ -29,7 +29,7 @@ import java.util.function.BiConsumer; import java.util.function.BiFunction; import java.util.function.Consumer; -import jdk.internal.misc.SharedSecrets; +import jdk.internal.access.SharedSecrets; /** * This class implements the {@code Map} interface with a hash table, using --- old/src/java.base/share/classes/java/util/ImmutableCollections.java 2018-11-01 19:07:45.000000000 -0700 +++ new/src/java.base/share/classes/java/util/ImmutableCollections.java 2018-11-01 19:07:45.000000000 -0700 @@ -35,7 +35,7 @@ import java.util.function.Function; import java.util.function.Predicate; import java.util.function.UnaryOperator; -import jdk.internal.misc.SharedSecrets; +import jdk.internal.access.SharedSecrets; import jdk.internal.misc.VM; import jdk.internal.vm.annotation.Stable; --- old/src/java.base/share/classes/java/util/PriorityQueue.java 2018-11-01 19:07:46.000000000 -0700 +++ new/src/java.base/share/classes/java/util/PriorityQueue.java 2018-11-01 19:07:46.000000000 -0700 @@ -27,7 +27,7 @@ import java.util.function.Consumer; import java.util.function.Predicate; -import jdk.internal.misc.SharedSecrets; +import jdk.internal.access.SharedSecrets; /** * An unbounded priority {@linkplain Queue queue} based on a priority heap. --- old/src/java.base/share/classes/java/util/Properties.java 2018-11-01 19:07:48.000000000 -0700 +++ new/src/java.base/share/classes/java/util/Properties.java 2018-11-01 19:07:47.000000000 -0700 @@ -46,7 +46,7 @@ import java.util.function.BiFunction; import java.util.function.Function; -import jdk.internal.misc.SharedSecrets; +import jdk.internal.access.SharedSecrets; import jdk.internal.misc.Unsafe; import jdk.internal.util.xml.PropertiesDefaultHandler; --- old/src/java.base/share/classes/java/util/ResourceBundle.java 2018-11-01 19:07:49.000000000 -0700 +++ new/src/java.base/share/classes/java/util/ResourceBundle.java 2018-11-01 19:07:48.000000000 -0700 @@ -66,8 +66,8 @@ import java.util.stream.Stream; import jdk.internal.loader.BootLoader; -import jdk.internal.misc.JavaUtilResourceBundleAccess; -import jdk.internal.misc.SharedSecrets; +import jdk.internal.access.JavaUtilResourceBundleAccess; +import jdk.internal.access.SharedSecrets; import jdk.internal.reflect.CallerSensitive; import jdk.internal.reflect.Reflection; import sun.security.action.GetPropertyAction; --- old/src/java.base/share/classes/java/util/ServiceLoader.java 2018-11-01 19:07:50.000000000 -0700 +++ new/src/java.base/share/classes/java/util/ServiceLoader.java 2018-11-01 19:07:50.000000000 -0700 @@ -47,8 +47,8 @@ import jdk.internal.loader.BootLoader; import jdk.internal.loader.ClassLoaders; -import jdk.internal.misc.JavaLangAccess; -import jdk.internal.misc.SharedSecrets; +import jdk.internal.access.JavaLangAccess; +import jdk.internal.access.SharedSecrets; import jdk.internal.misc.VM; import jdk.internal.module.ServicesCatalog; import jdk.internal.module.ServicesCatalog.ServiceProvider; --- old/src/java.base/share/classes/java/util/UUID.java 2018-11-01 19:07:51.000000000 -0700 +++ new/src/java.base/share/classes/java/util/UUID.java 2018-11-01 19:07:51.000000000 -0700 @@ -27,8 +27,8 @@ import java.security.*; -import jdk.internal.misc.JavaLangAccess; -import jdk.internal.misc.SharedSecrets; +import jdk.internal.access.JavaLangAccess; +import jdk.internal.access.SharedSecrets; /** * A class that represents an immutable universally unique identifier (UUID). --- old/src/java.base/share/classes/java/util/concurrent/CopyOnWriteArrayList.java 2018-11-01 19:07:53.000000000 -0700 +++ new/src/java.base/share/classes/java/util/concurrent/CopyOnWriteArrayList.java 2018-11-01 19:07:52.000000000 -0700 @@ -51,7 +51,7 @@ import java.util.function.Consumer; import java.util.function.Predicate; import java.util.function.UnaryOperator; -import jdk.internal.misc.SharedSecrets; +import jdk.internal.access.SharedSecrets; /** * A thread-safe variant of {@link java.util.ArrayList} in which all mutative --- old/src/java.base/share/classes/java/util/concurrent/PriorityBlockingQueue.java 2018-11-01 19:07:54.000000000 -0700 +++ new/src/java.base/share/classes/java/util/concurrent/PriorityBlockingQueue.java 2018-11-01 19:07:54.000000000 -0700 @@ -52,7 +52,7 @@ import java.util.concurrent.locks.ReentrantLock; import java.util.function.Consumer; import java.util.function.Predicate; -import jdk.internal.misc.SharedSecrets; +import jdk.internal.access.SharedSecrets; /** * An unbounded {@linkplain BlockingQueue blocking queue} that uses --- old/src/java.base/share/classes/java/util/jar/JarFile.java 2018-11-01 19:07:55.000000000 -0700 +++ new/src/java.base/share/classes/java/util/jar/JarFile.java 2018-11-01 19:07:55.000000000 -0700 @@ -25,8 +25,8 @@ package java.util.jar; -import jdk.internal.misc.SharedSecrets; -import jdk.internal.misc.JavaUtilZipFileAccess; +import jdk.internal.access.SharedSecrets; +import jdk.internal.access.JavaUtilZipFileAccess; import sun.security.action.GetPropertyAction; import sun.security.util.ManifestEntryVerifier; import sun.security.util.SignatureFileVerifier; @@ -172,7 +172,7 @@ // Set up JavaUtilJarAccess in SharedSecrets SharedSecrets.setJavaUtilJarAccess(new JavaUtilJarAccessImpl()); // Get JavaUtilZipFileAccess from SharedSecrets - JUZFA = jdk.internal.misc.SharedSecrets.getJavaUtilZipFileAccess(); + JUZFA = SharedSecrets.getJavaUtilZipFileAccess(); // multi-release jar file versions >= 9 BASE_VERSION = Runtime.Version.parse(Integer.toString(8)); BASE_VERSION_FEATURE = BASE_VERSION.feature(); --- old/src/java.base/share/classes/java/util/jar/JavaUtilJarAccessImpl.java 2018-11-01 19:07:56.000000000 -0700 +++ new/src/java.base/share/classes/java/util/jar/JavaUtilJarAccessImpl.java 2018-11-01 19:07:56.000000000 -0700 @@ -30,7 +30,7 @@ import java.security.CodeSource; import java.util.Enumeration; import java.util.List; -import jdk.internal.misc.JavaUtilJarAccess; +import jdk.internal.access.JavaUtilJarAccess; class JavaUtilJarAccessImpl implements JavaUtilJarAccess { public boolean jarFileHasClassPathAttribute(JarFile jar) throws IOException { --- old/src/java.base/share/classes/java/util/spi/AbstractResourceBundleProvider.java 2018-11-01 19:07:58.000000000 -0700 +++ new/src/java.base/share/classes/java/util/spi/AbstractResourceBundleProvider.java 2018-11-01 19:07:57.000000000 -0700 @@ -25,8 +25,8 @@ package java.util.spi; -import jdk.internal.misc.JavaUtilResourceBundleAccess; -import jdk.internal.misc.SharedSecrets; +import jdk.internal.access.JavaUtilResourceBundleAccess; +import jdk.internal.access.SharedSecrets; import java.io.IOException; import java.io.InputStream; --- old/src/java.base/share/classes/java/util/zip/ZipCoder.java 2018-11-01 19:07:59.000000000 -0700 +++ new/src/java.base/share/classes/java/util/zip/ZipCoder.java 2018-11-01 19:07:58.000000000 -0700 @@ -41,8 +41,8 @@ class ZipCoder { - private static final jdk.internal.misc.JavaLangAccess JLA = - jdk.internal.misc.SharedSecrets.getJavaLangAccess(); + private static final jdk.internal.access.JavaLangAccess JLA = + jdk.internal.access.SharedSecrets.getJavaLangAccess(); static final class UTF8 extends ZipCoder { --- old/src/java.base/share/classes/java/util/zip/ZipFile.java 2018-11-01 19:08:00.000000000 -0700 +++ new/src/java.base/share/classes/java/util/zip/ZipFile.java 2018-11-01 19:08:00.000000000 -0700 @@ -58,9 +58,9 @@ import java.util.jar.JarEntry; import java.util.stream.Stream; import java.util.stream.StreamSupport; -import jdk.internal.misc.JavaLangAccess; -import jdk.internal.misc.JavaUtilZipFileAccess; -import jdk.internal.misc.SharedSecrets; +import jdk.internal.access.JavaLangAccess; +import jdk.internal.access.JavaUtilZipFileAccess; +import jdk.internal.access.SharedSecrets; import jdk.internal.misc.VM; import jdk.internal.perf.PerfCounter; import jdk.internal.ref.CleanerFactory; @@ -1071,7 +1071,7 @@ } } ); - JLA = jdk.internal.misc.SharedSecrets.getJavaLangAccess(); + JLA = SharedSecrets.getJavaLangAccess(); isWindows = VM.getSavedProperty("os.name").contains("Windows"); } --- old/src/java.base/share/classes/javax/crypto/SealedObject.java 2018-11-01 19:08:01.000000000 -0700 +++ new/src/java.base/share/classes/javax/crypto/SealedObject.java 2018-11-01 19:08:01.000000000 -0700 @@ -25,7 +25,7 @@ package javax.crypto; -import jdk.internal.misc.SharedSecrets; +import jdk.internal.access.SharedSecrets; import java.io.*; import java.security.AlgorithmParameters; --- old/src/java.base/share/classes/jdk/internal/loader/AbstractClassLoaderValue.java 2018-11-01 19:08:03.000000000 -0700 +++ new/src/java.base/share/classes/jdk/internal/loader/AbstractClassLoaderValue.java 2018-11-01 19:08:02.000000000 -0700 @@ -25,8 +25,8 @@ package jdk.internal.loader; -import jdk.internal.misc.JavaLangAccess; -import jdk.internal.misc.SharedSecrets; +import jdk.internal.access.JavaLangAccess; +import jdk.internal.access.SharedSecrets; import java.lang.reflect.UndeclaredThrowableException; import java.util.Iterator; --- old/src/java.base/share/classes/jdk/internal/loader/BootLoader.java 2018-11-01 19:08:04.000000000 -0700 +++ new/src/java.base/share/classes/jdk/internal/loader/BootLoader.java 2018-11-01 19:08:03.000000000 -0700 @@ -36,14 +36,13 @@ import java.security.PrivilegedAction; import java.util.Arrays; import java.util.Enumeration; -import java.util.Optional; import java.util.concurrent.ConcurrentHashMap; import java.util.jar.JarInputStream; import java.util.jar.Manifest; import java.util.stream.Stream; -import jdk.internal.misc.JavaLangAccess; -import jdk.internal.misc.SharedSecrets; +import jdk.internal.access.JavaLangAccess; +import jdk.internal.access.SharedSecrets; import jdk.internal.module.Modules; import jdk.internal.module.ServicesCatalog; import jdk.internal.util.StaticProperty; --- old/src/java.base/share/classes/jdk/internal/loader/BuiltinClassLoader.java 2018-11-01 19:08:05.000000000 -0700 +++ new/src/java.base/share/classes/jdk/internal/loader/BuiltinClassLoader.java 2018-11-01 19:08:04.000000000 -0700 @@ -60,7 +60,7 @@ import java.util.jar.Manifest; import java.util.stream.Stream; -import jdk.internal.misc.SharedSecrets; +import jdk.internal.access.SharedSecrets; import jdk.internal.misc.VM; import jdk.internal.module.ModulePatcher.PatchedModuleReader; import jdk.internal.module.Resources; --- old/src/java.base/share/classes/jdk/internal/loader/ClassLoaders.java 2018-11-01 19:08:06.000000000 -0700 +++ new/src/java.base/share/classes/jdk/internal/loader/ClassLoaders.java 2018-11-01 19:08:06.000000000 -0700 @@ -33,8 +33,8 @@ import java.security.PermissionCollection; import java.util.jar.Manifest; -import jdk.internal.misc.JavaLangAccess; -import jdk.internal.misc.SharedSecrets; +import jdk.internal.access.JavaLangAccess; +import jdk.internal.access.SharedSecrets; import jdk.internal.misc.VM; /** --- old/src/java.base/share/classes/jdk/internal/loader/Loader.java 2018-11-01 19:08:07.000000000 -0700 +++ new/src/java.base/share/classes/jdk/internal/loader/Loader.java 2018-11-01 19:08:07.000000000 -0700 @@ -60,7 +60,7 @@ import java.util.concurrent.ConcurrentHashMap; import java.util.stream.Stream; -import jdk.internal.misc.SharedSecrets; +import jdk.internal.access.SharedSecrets; import jdk.internal.module.Resources; /** --- old/src/java.base/share/classes/jdk/internal/loader/URLClassPath.java 2018-11-01 19:08:09.000000000 -0700 +++ new/src/java.base/share/classes/jdk/internal/loader/URLClassPath.java 2018-11-01 19:08:08.000000000 -0700 @@ -68,9 +68,9 @@ import java.util.jar.Attributes.Name; import java.util.zip.ZipFile; -import jdk.internal.misc.JavaNetURLAccess; -import jdk.internal.misc.JavaUtilZipFileAccess; -import jdk.internal.misc.SharedSecrets; +import jdk.internal.access.JavaNetURLAccess; +import jdk.internal.access.JavaUtilZipFileAccess; +import jdk.internal.access.SharedSecrets; import jdk.internal.util.jar.InvalidJarIndexError; import jdk.internal.util.jar.JarIndex; import sun.net.util.URLUtil; --- old/src/java.base/share/classes/jdk/internal/misc/Unsafe.java 2018-11-01 19:08:10.000000000 -0700 +++ new/src/java.base/share/classes/jdk/internal/misc/Unsafe.java 2018-11-01 19:08:09.000000000 -0700 @@ -26,7 +26,9 @@ package jdk.internal.misc; import jdk.internal.HotSpotIntrinsicCandidate; +import jdk.internal.ref.Cleaner; import jdk.internal.vm.annotation.ForceInline; +import sun.nio.ch.DirectBuffer; import java.lang.reflect.Field; import java.security.ProtectionDomain; @@ -3718,6 +3720,29 @@ private native boolean isBigEndian0(); + /** + * Invokes the given direct byte buffer's cleaner, if any. + * + * @param directBuffer a direct byte buffer + * @throws NullPointerException if {@code directBuffer} is null + * @throws IllegalArgumentException if {@code directBuffer} is non-direct, + * or is a {@link java.nio.Buffer#slice slice}, or is a + * {@link java.nio.Buffer#duplicate duplicate} + */ + public void invokeCleaner(java.nio.ByteBuffer directBuffer) { + if (!directBuffer.isDirect()) + throw new IllegalArgumentException("buffer is non-direct"); + + DirectBuffer db = (DirectBuffer) directBuffer; + if (db.attachment() != null) + throw new IllegalArgumentException("duplicate or slice"); + + Cleaner cleaner = db.cleaner(); + if (cleaner != null) { + cleaner.clean(); + } + } + // The following deprecated methods are used by JSR 166. @Deprecated(since="12", forRemoval=true) --- old/src/java.base/share/classes/jdk/internal/module/Builder.java 2018-11-01 19:08:11.000000000 -0700 +++ new/src/java.base/share/classes/jdk/internal/module/Builder.java 2018-11-01 19:08:11.000000000 -0700 @@ -33,8 +33,8 @@ import java.util.List; import java.util.Set; -import jdk.internal.misc.JavaLangModuleAccess; -import jdk.internal.misc.SharedSecrets; +import jdk.internal.access.JavaLangModuleAccess; +import jdk.internal.access.SharedSecrets; /** * This builder is optimized for reconstituting the {@code ModuleDescriptor}s --- old/src/java.base/share/classes/jdk/internal/module/IllegalAccessLogger.java 2018-11-01 19:08:12.000000000 -0700 +++ new/src/java.base/share/classes/jdk/internal/module/IllegalAccessLogger.java 2018-11-01 19:08:12.000000000 -0700 @@ -44,8 +44,8 @@ import java.util.stream.Collectors; import static java.util.Collections.*; -import jdk.internal.misc.JavaLangAccess; -import jdk.internal.misc.SharedSecrets; +import jdk.internal.access.JavaLangAccess; +import jdk.internal.access.SharedSecrets; /** * Supports logging of access to members of exported and concealed packages --- old/src/java.base/share/classes/jdk/internal/module/ModuleBootstrap.java 2018-11-01 19:08:14.000000000 -0700 +++ new/src/java.base/share/classes/jdk/internal/module/ModuleBootstrap.java 2018-11-01 19:08:13.000000000 -0700 @@ -51,10 +51,9 @@ import jdk.internal.loader.BootLoader; import jdk.internal.loader.BuiltinClassLoader; -import jdk.internal.misc.JavaLangAccess; -import jdk.internal.misc.JavaLangModuleAccess; -import jdk.internal.misc.SharedSecrets; -import jdk.internal.misc.VM; +import jdk.internal.access.JavaLangAccess; +import jdk.internal.access.JavaLangModuleAccess; +import jdk.internal.access.SharedSecrets; import jdk.internal.perf.PerfCounter; /** --- old/src/java.base/share/classes/jdk/internal/module/ModuleInfo.java 2018-11-01 19:08:15.000000000 -0700 +++ new/src/java.base/share/classes/jdk/internal/module/ModuleInfo.java 2018-11-01 19:08:15.000000000 -0700 @@ -47,8 +47,8 @@ import java.util.Set; import java.util.function.Supplier; -import jdk.internal.misc.JavaLangModuleAccess; -import jdk.internal.misc.SharedSecrets; +import jdk.internal.access.JavaLangModuleAccess; +import jdk.internal.access.SharedSecrets; import static jdk.internal.module.ClassFileConstants.*; --- old/src/java.base/share/classes/jdk/internal/module/ModulePatcher.java 2018-11-01 19:08:16.000000000 -0700 +++ new/src/java.base/share/classes/jdk/internal/module/ModulePatcher.java 2018-11-01 19:08:16.000000000 -0700 @@ -54,8 +54,8 @@ import java.util.stream.Stream; import jdk.internal.loader.Resource; -import jdk.internal.misc.JavaLangModuleAccess; -import jdk.internal.misc.SharedSecrets; +import jdk.internal.access.JavaLangModuleAccess; +import jdk.internal.access.SharedSecrets; import sun.net.www.ParseUtil; --- old/src/java.base/share/classes/jdk/internal/module/Modules.java 2018-11-01 19:08:17.000000000 -0700 +++ new/src/java.base/share/classes/jdk/internal/module/Modules.java 2018-11-01 19:08:17.000000000 -0700 @@ -43,8 +43,8 @@ import jdk.internal.loader.BootLoader; import jdk.internal.loader.BuiltinClassLoader; import jdk.internal.loader.ClassLoaders; -import jdk.internal.misc.JavaLangAccess; -import jdk.internal.misc.SharedSecrets; +import jdk.internal.access.JavaLangAccess; +import jdk.internal.access.SharedSecrets; /** * A helper class for creating and updating modules. This class is intended to --- old/src/java.base/share/classes/jdk/internal/module/SystemModuleFinders.java 2018-11-01 19:08:19.000000000 -0700 +++ new/src/java.base/share/classes/jdk/internal/module/SystemModuleFinders.java 2018-11-01 19:08:18.000000000 -0700 @@ -59,8 +59,8 @@ import jdk.internal.jimage.ImageLocation; import jdk.internal.jimage.ImageReader; import jdk.internal.jimage.ImageReaderFactory; -import jdk.internal.misc.JavaNetUriAccess; -import jdk.internal.misc.SharedSecrets; +import jdk.internal.access.JavaNetUriAccess; +import jdk.internal.access.SharedSecrets; import jdk.internal.util.StaticProperty; import jdk.internal.module.ModuleHashes.HashSupplier; --- old/src/java.base/share/classes/jdk/internal/reflect/ClassDefiner.java 2018-11-01 19:08:20.000000000 -0700 +++ new/src/java.base/share/classes/jdk/internal/reflect/ClassDefiner.java 2018-11-01 19:08:19.000000000 -0700 @@ -28,8 +28,8 @@ import java.security.AccessController; import java.security.PrivilegedAction; -import jdk.internal.misc.JavaLangAccess; -import jdk.internal.misc.SharedSecrets; +import jdk.internal.access.JavaLangAccess; +import jdk.internal.access.SharedSecrets; /** Utility class which assists in calling defineClass() by creating a new class loader which delegates to the one needed in --- old/src/java.base/share/classes/module-info.java 2018-11-01 19:08:21.000000000 -0700 +++ new/src/java.base/share/classes/module-info.java 2018-11-01 19:08:20.000000000 -0700 @@ -136,6 +136,14 @@ java.security.sasl; exports jdk.internal to jdk.jfr; + exports jdk.internal.access to + java.desktop, + java.logging, + java.management, + java.naming, + java.rmi, + jdk.jlink, + jdk.net; exports jdk.internal.event to jdk.jfr; exports jdk.internal.jimage to @@ -175,18 +183,15 @@ java.logging, java.management, java.naming, + java.net.http, java.rmi, java.security.jgss, - java.sql, java.xml, jdk.attach, jdk.charsets, jdk.compiler, - java.net.http, jdk.jfr, - jdk.jlink, jdk.jshell, - jdk.net, jdk.scripting.nashorn, jdk.scripting.nashorn.shell, jdk.unsupported, @@ -202,8 +207,7 @@ jdk.management.agent, jdk.internal.jvmstat; exports jdk.internal.ref to - java.desktop, - jdk.unsupported; + java.desktop; exports jdk.internal.reflect to java.logging, java.sql, @@ -244,12 +248,9 @@ java.management, jdk.crypto.cryptoki, jdk.net, - jdk.sctp, - jdk.unsupported; + jdk.sctp; exports sun.nio.cs to jdk.charsets; - exports sun.nio.fs to - jdk.unsupported; exports sun.reflect.annotation to jdk.compiler; exports sun.reflect.generics.reflectiveObjects to --- old/src/java.base/share/classes/sun/net/sdp/SdpSupport.java 2018-11-01 19:08:22.000000000 -0700 +++ new/src/java.base/share/classes/sun/net/sdp/SdpSupport.java 2018-11-01 19:08:22.000000000 -0700 @@ -29,8 +29,8 @@ import java.io.FileDescriptor; import java.security.AccessController; -import jdk.internal.misc.SharedSecrets; -import jdk.internal.misc.JavaIOFileDescriptorAccess; +import jdk.internal.access.SharedSecrets; +import jdk.internal.access.JavaIOFileDescriptorAccess; import sun.security.action.GetPropertyAction; --- old/src/java.base/share/classes/sun/net/www/protocol/http/HttpURLConnection.java 2018-11-01 19:08:23.000000000 -0700 +++ new/src/java.base/share/classes/sun/net/www/protocol/http/HttpURLConnection.java 2018-11-01 19:08:23.000000000 -0700 @@ -65,8 +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 jdk.internal.access.JavaNetHttpCookieAccess; +import jdk.internal.access.SharedSecrets; import sun.net.*; import sun.net.www.*; import sun.net.www.http.HttpClient; --- old/src/java.base/share/classes/sun/nio/ch/FileChannelImpl.java 2018-11-01 19:08:25.000000000 -0700 +++ new/src/java.base/share/classes/sun/nio/ch/FileChannelImpl.java 2018-11-01 19:08:24.000000000 -0700 @@ -43,9 +43,9 @@ import java.nio.channels.SelectableChannel; import java.nio.channels.WritableByteChannel; -import jdk.internal.misc.JavaIOFileDescriptorAccess; -import jdk.internal.misc.JavaNioAccess; -import jdk.internal.misc.SharedSecrets; +import jdk.internal.access.JavaIOFileDescriptorAccess; +import jdk.internal.access.JavaNioAccess; +import jdk.internal.access.SharedSecrets; import jdk.internal.ref.Cleaner; import jdk.internal.ref.CleanerFactory; --- old/src/java.base/share/classes/sun/reflect/annotation/AnnotationSupport.java 2018-11-01 19:08:26.000000000 -0700 +++ new/src/java.base/share/classes/sun/reflect/annotation/AnnotationSupport.java 2018-11-01 19:08:26.000000000 -0700 @@ -35,8 +35,8 @@ import java.util.Map; import java.util.Objects; -import jdk.internal.misc.SharedSecrets; -import jdk.internal.misc.JavaLangAccess; +import jdk.internal.access.SharedSecrets; +import jdk.internal.access.JavaLangAccess; import jdk.internal.reflect.ReflectionFactory; public final class AnnotationSupport { --- old/src/java.base/share/classes/sun/reflect/annotation/AnnotationType.java 2018-11-01 19:08:27.000000000 -0700 +++ new/src/java.base/share/classes/sun/reflect/annotation/AnnotationType.java 2018-11-01 19:08:27.000000000 -0700 @@ -30,8 +30,8 @@ import java.util.*; import java.security.AccessController; import java.security.PrivilegedAction; -import jdk.internal.misc.SharedSecrets; -import jdk.internal.misc.JavaLangAccess; +import jdk.internal.access.SharedSecrets; +import jdk.internal.access.JavaLangAccess; /** * Represents an annotation type at run time. Used to type-check annotations --- old/src/java.base/share/classes/sun/reflect/annotation/TypeAnnotationParser.java 2018-11-01 19:08:28.000000000 -0700 +++ new/src/java.base/share/classes/sun/reflect/annotation/TypeAnnotationParser.java 2018-11-01 19:08:28.000000000 -0700 @@ -34,8 +34,8 @@ import java.util.List; import java.util.LinkedHashMap; import java.util.Map; -import jdk.internal.misc.SharedSecrets; -import jdk.internal.misc.JavaLangAccess; +import jdk.internal.access.SharedSecrets; +import jdk.internal.access.JavaLangAccess; import jdk.internal.reflect.ConstantPool; import static sun.reflect.annotation.TypeAnnotation.*; --- old/src/java.base/share/classes/sun/security/provider/PolicyFile.java 2018-11-01 19:08:30.000000000 -0700 +++ new/src/java.base/share/classes/sun/security/provider/PolicyFile.java 2018-11-01 19:08:29.000000000 -0700 @@ -41,9 +41,9 @@ import java.net.SocketPermission; import java.net.NetPermission; import java.util.concurrent.ConcurrentHashMap; -import jdk.internal.misc.JavaSecurityAccess; -import static jdk.internal.misc.JavaSecurityAccess.ProtectionDomainCache; -import jdk.internal.misc.SharedSecrets; +import jdk.internal.access.JavaSecurityAccess; +import static jdk.internal.access.JavaSecurityAccess.ProtectionDomainCache; +import jdk.internal.access.SharedSecrets; import jdk.internal.util.StaticProperty; import sun.security.util.*; import sun.net.www.ParseUtil; --- old/src/java.base/share/classes/sun/security/ssl/SSLSocketImpl.java 2018-11-01 19:08:31.000000000 -0700 +++ new/src/java.base/share/classes/sun/security/ssl/SSLSocketImpl.java 2018-11-01 19:08:30.000000000 -0700 @@ -47,8 +47,8 @@ import javax.net.ssl.SSLServerSocket; import javax.net.ssl.SSLSession; import javax.net.ssl.SSLSocket; -import jdk.internal.misc.JavaNetInetAddressAccess; -import jdk.internal.misc.SharedSecrets; +import jdk.internal.access.JavaNetInetAddressAccess; +import jdk.internal.access.SharedSecrets; /** * Implementation of an SSL socket. @@ -1229,7 +1229,7 @@ // identification. Use the application original specified // hostname or IP address instead. - // Get the original hostname via jdk.internal.misc.SharedSecrets + // Get the original hostname via jdk.internal.access.SharedSecrets InetAddress inetAddress = getInetAddress(); if (inetAddress == null) { // not connected return; --- old/src/java.base/share/classes/sun/security/util/FilePermCompat.java 2018-11-01 19:08:32.000000000 -0700 +++ new/src/java.base/share/classes/sun/security/util/FilePermCompat.java 2018-11-01 19:08:32.000000000 -0700 @@ -29,7 +29,7 @@ import java.io.FilePermission; import java.security.Permission; -import jdk.internal.misc.SharedSecrets; +import jdk.internal.access.SharedSecrets; /** * Take care of FilePermission compatibility after JDK-8164705. --- old/src/java.base/share/classes/sun/security/util/Password.java 2018-11-01 19:08:33.000000000 -0700 +++ new/src/java.base/share/classes/sun/security/util/Password.java 2018-11-01 19:08:33.000000000 -0700 @@ -29,7 +29,7 @@ import java.nio.*; import java.nio.charset.*; import java.util.Arrays; -import jdk.internal.misc.SharedSecrets; +import jdk.internal.access.SharedSecrets; /** * A utility class for reading passwords --- old/src/java.base/share/classes/sun/text/bidi/BidiBase.java 2018-11-01 19:08:35.000000000 -0700 +++ new/src/java.base/share/classes/sun/text/bidi/BidiBase.java 2018-11-01 19:08:34.000000000 -0700 @@ -52,8 +52,8 @@ import java.text.AttributedCharacterIterator; import java.text.Bidi; import java.util.Arrays; -import jdk.internal.misc.JavaAWTFontAccess; -import jdk.internal.misc.SharedSecrets; +import jdk.internal.access.JavaAWTFontAccess; +import jdk.internal.access.SharedSecrets; import sun.text.normalizer.UBiDiProps; import sun.text.normalizer.UCharacter; import sun.text.normalizer.UTF16; --- old/src/java.base/share/classes/sun/util/resources/Bundles.java 2018-11-01 19:08:36.000000000 -0700 +++ new/src/java.base/share/classes/sun/util/resources/Bundles.java 2018-11-01 19:08:36.000000000 -0700 @@ -56,8 +56,8 @@ import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; import java.util.spi.ResourceBundleProvider; -import jdk.internal.misc.JavaUtilResourceBundleAccess; -import jdk.internal.misc.SharedSecrets; +import jdk.internal.access.JavaUtilResourceBundleAccess; +import jdk.internal.access.SharedSecrets; /** */ --- old/src/java.base/unix/classes/java/lang/ProcessImpl.java 2018-11-01 19:08:37.000000000 -0700 +++ new/src/java.base/unix/classes/java/lang/ProcessImpl.java 2018-11-01 19:08:37.000000000 -0700 @@ -47,8 +47,8 @@ import java.security.PrivilegedActionException; import java.security.PrivilegedExceptionAction; import java.util.Properties; -import jdk.internal.misc.JavaIOFileDescriptorAccess; -import jdk.internal.misc.SharedSecrets; +import jdk.internal.access.JavaIOFileDescriptorAccess; +import jdk.internal.access.SharedSecrets; import jdk.internal.util.StaticProperty; import sun.security.action.GetPropertyAction; --- old/src/java.base/unix/classes/sun/nio/ch/FileDispatcherImpl.java 2018-11-01 19:08:39.000000000 -0700 +++ new/src/java.base/unix/classes/sun/nio/ch/FileDispatcherImpl.java 2018-11-01 19:08:38.000000000 -0700 @@ -28,8 +28,8 @@ import java.io.FileDescriptor; import java.io.IOException; -import jdk.internal.misc.JavaIOFileDescriptorAccess; -import jdk.internal.misc.SharedSecrets; +import jdk.internal.access.JavaIOFileDescriptorAccess; +import jdk.internal.access.SharedSecrets; class FileDispatcherImpl extends FileDispatcher { --- old/src/java.base/unix/classes/sun/nio/fs/UnixChannelFactory.java 2018-11-01 19:08:40.000000000 -0700 +++ new/src/java.base/unix/classes/sun/nio/fs/UnixChannelFactory.java 2018-11-01 19:08:39.000000000 -0700 @@ -30,8 +30,8 @@ import java.io.FileDescriptor; import java.util.Set; -import jdk.internal.misc.SharedSecrets; -import jdk.internal.misc.JavaIOFileDescriptorAccess; +import jdk.internal.access.SharedSecrets; +import jdk.internal.access.JavaIOFileDescriptorAccess; import sun.nio.ch.FileChannelImpl; import sun.nio.ch.ThreadPool; import sun.nio.ch.SimpleAsynchronousFileChannelImpl; --- old/src/java.base/windows/classes/java/lang/ProcessImpl.java 2018-11-01 19:08:41.000000000 -0700 +++ new/src/java.base/windows/classes/java/lang/ProcessImpl.java 2018-11-01 19:08:41.000000000 -0700 @@ -43,8 +43,8 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; -import jdk.internal.misc.JavaIOFileDescriptorAccess; -import jdk.internal.misc.SharedSecrets; +import jdk.internal.access.JavaIOFileDescriptorAccess; +import jdk.internal.access.SharedSecrets; import jdk.internal.ref.CleanerFactory; /* This class is for the exclusive use of ProcessBuilder.start() to --- old/src/java.base/windows/classes/java/net/DualStackPlainDatagramSocketImpl.java 2018-11-01 19:08:43.000000000 -0700 +++ new/src/java.base/windows/classes/java/net/DualStackPlainDatagramSocketImpl.java 2018-11-01 19:08:42.000000000 -0700 @@ -25,8 +25,8 @@ package java.net; import java.io.IOException; -import jdk.internal.misc.SharedSecrets; -import jdk.internal.misc.JavaIOFileDescriptorAccess; +import jdk.internal.access.SharedSecrets; +import jdk.internal.access.JavaIOFileDescriptorAccess; /** * This class defines the plain DatagramSocketImpl that is used on --- old/src/java.base/windows/classes/java/net/PlainSocketImpl.java 2018-11-01 19:08:44.000000000 -0700 +++ new/src/java.base/windows/classes/java/net/PlainSocketImpl.java 2018-11-01 19:08:43.000000000 -0700 @@ -27,10 +27,10 @@ import java.io.IOException; import java.io.FileDescriptor; import java.security.AccessController; -import java.security.PrivilegedAction; + import sun.security.action.GetPropertyAction; -import jdk.internal.misc.SharedSecrets; -import jdk.internal.misc.JavaIOFileDescriptorAccess; +import jdk.internal.access.SharedSecrets; +import jdk.internal.access.JavaIOFileDescriptorAccess; /** * On Windows system we simply delegate to native methods. --- old/src/java.base/windows/classes/sun/nio/ch/FileDispatcherImpl.java 2018-11-01 19:08:45.000000000 -0700 +++ new/src/java.base/windows/classes/sun/nio/ch/FileDispatcherImpl.java 2018-11-01 19:08:44.000000000 -0700 @@ -27,8 +27,8 @@ import java.io.FileDescriptor; import java.io.IOException; -import jdk.internal.misc.SharedSecrets; -import jdk.internal.misc.JavaIOFileDescriptorAccess; +import jdk.internal.access.SharedSecrets; +import jdk.internal.access.JavaIOFileDescriptorAccess; import sun.security.action.GetPropertyAction; import java.io.File; import java.nio.CharBuffer; --- old/src/java.base/windows/classes/sun/nio/ch/WindowsAsynchronousFileChannelImpl.java 2018-11-01 19:08:46.000000000 -0700 +++ new/src/java.base/windows/classes/sun/nio/ch/WindowsAsynchronousFileChannelImpl.java 2018-11-01 19:08:46.000000000 -0700 @@ -31,8 +31,8 @@ import java.nio.BufferOverflowException; import java.io.IOException; import java.io.FileDescriptor; -import jdk.internal.misc.SharedSecrets; -import jdk.internal.misc.JavaIOFileDescriptorAccess; +import jdk.internal.access.SharedSecrets; +import jdk.internal.access.JavaIOFileDescriptorAccess; /** * Windows implementation of AsynchronousFileChannel using overlapped I/O. --- old/src/java.base/windows/classes/sun/nio/fs/WindowsChannelFactory.java 2018-11-01 19:08:47.000000000 -0700 +++ new/src/java.base/windows/classes/sun/nio/fs/WindowsChannelFactory.java 2018-11-01 19:08:47.000000000 -0700 @@ -34,8 +34,8 @@ import java.nio.file.StandardOpenOption; import java.util.Set; -import jdk.internal.misc.JavaIOFileDescriptorAccess; -import jdk.internal.misc.SharedSecrets; +import jdk.internal.access.JavaIOFileDescriptorAccess; +import jdk.internal.access.SharedSecrets; import sun.nio.ch.FileChannelImpl; import sun.nio.ch.ThreadPool; import sun.nio.ch.WindowsAsynchronousFileChannelImpl; --- old/src/java.desktop/share/classes/com/sun/beans/decoder/DocumentHandler.java 2018-11-01 19:08:49.000000000 -0700 +++ new/src/java.desktop/share/classes/com/sun/beans/decoder/DocumentHandler.java 2018-11-01 19:08:48.000000000 -0700 @@ -50,7 +50,7 @@ import org.xml.sax.SAXException; import org.xml.sax.helpers.DefaultHandler; -import jdk.internal.misc.SharedSecrets; +import jdk.internal.access.SharedSecrets; /** * The main class to parse JavaBeans XML archive. --- old/src/java.desktop/share/classes/java/awt/EventQueue.java 2018-11-01 19:08:50.000000000 -0700 +++ new/src/java.desktop/share/classes/java/awt/EventQueue.java 2018-11-01 19:08:50.000000000 -0700 @@ -47,8 +47,8 @@ import java.security.AccessControlContext; -import jdk.internal.misc.SharedSecrets; -import jdk.internal.misc.JavaSecurityAccess; +import jdk.internal.access.SharedSecrets; +import jdk.internal.access.JavaSecurityAccess; /** * {@code EventQueue} is a platform-independent class --- old/src/java.desktop/share/classes/java/awt/font/JavaAWTFontAccessImpl.java 2018-11-01 19:08:52.000000000 -0700 +++ new/src/java.desktop/share/classes/java/awt/font/JavaAWTFontAccessImpl.java 2018-11-01 19:08:51.000000000 -0700 @@ -25,7 +25,7 @@ package java.awt.font; -import jdk.internal.misc.JavaAWTFontAccess; +import jdk.internal.access.JavaAWTFontAccess; class JavaAWTFontAccessImpl implements JavaAWTFontAccess { --- old/src/java.desktop/share/classes/java/awt/font/NumericShaper.java 2018-11-01 19:08:53.000000000 -0700 +++ new/src/java.desktop/share/classes/java/awt/font/NumericShaper.java 2018-11-01 19:08:52.000000000 -0700 @@ -31,7 +31,7 @@ import java.util.Comparator; import java.util.EnumSet; import java.util.Set; -import jdk.internal.misc.SharedSecrets; +import jdk.internal.access.SharedSecrets; /** * The {@code NumericShaper} class is used to convert Latin-1 (European) --- old/src/java.desktop/share/classes/java/awt/font/TextAttribute.java 2018-11-01 19:08:54.000000000 -0700 +++ new/src/java.desktop/share/classes/java/awt/font/TextAttribute.java 2018-11-01 19:08:54.000000000 -0700 @@ -44,7 +44,7 @@ import java.text.AttributedCharacterIterator.Attribute; import java.util.Map; import java.util.HashMap; -import jdk.internal.misc.SharedSecrets; +import jdk.internal.access.SharedSecrets; /** * The {@code TextAttribute} class defines attribute keys and --- old/src/java.desktop/share/classes/java/beans/Introspector.java 2018-11-01 19:08:55.000000000 -0700 +++ new/src/java.desktop/share/classes/java/beans/Introspector.java 2018-11-01 19:08:55.000000000 -0700 @@ -42,15 +42,14 @@ import java.util.Map; import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.Iterator; import java.util.EventObject; import java.util.List; import java.util.TreeMap; -import jdk.internal.misc.JavaBeansAccess; -import jdk.internal.misc.SharedSecrets; +import jdk.internal.access.JavaBeansAccess; +import jdk.internal.access.SharedSecrets; import sun.reflect.misc.ReflectUtil; /** --- old/src/java.desktop/share/classes/javax/swing/RepaintManager.java 2018-11-01 19:08:57.000000000 -0700 +++ new/src/java.desktop/share/classes/javax/swing/RepaintManager.java 2018-11-01 19:08:56.000000000 -0700 @@ -35,8 +35,8 @@ import java.util.concurrent.atomic.AtomicInteger; import java.applet.*; -import jdk.internal.misc.JavaSecurityAccess; -import jdk.internal.misc.SharedSecrets; +import jdk.internal.access.JavaSecurityAccess; +import jdk.internal.access.SharedSecrets; import sun.awt.AWTAccessor; import sun.awt.AppContext; import sun.awt.DisplayChangedListener; --- old/src/java.desktop/share/classes/javax/swing/TransferHandler.java 2018-11-01 19:08:58.000000000 -0700 +++ new/src/java.desktop/share/classes/javax/swing/TransferHandler.java 2018-11-01 19:08:58.000000000 -0700 @@ -46,9 +46,9 @@ import java.security.PrivilegedAction; import java.security.AccessControlContext; -import java.security.ProtectionDomain; -import jdk.internal.misc.SharedSecrets; -import jdk.internal.misc.JavaSecurityAccess; + +import jdk.internal.access.SharedSecrets; +import jdk.internal.access.JavaSecurityAccess; import sun.awt.AWTAccessor; --- old/src/java.desktop/share/classes/sun/awt/AppContext.java 2018-11-01 19:09:00.000000000 -0700 +++ new/src/java.desktop/share/classes/sun/awt/AppContext.java 2018-11-01 19:08:59.000000000 -0700 @@ -44,8 +44,8 @@ import java.beans.PropertyChangeListener; import java.lang.ref.SoftReference; -import jdk.internal.misc.JavaAWTAccess; -import jdk.internal.misc.SharedSecrets; +import jdk.internal.access.JavaAWTAccess; +import jdk.internal.access.SharedSecrets; import sun.util.logging.PlatformLogger; import java.util.concurrent.locks.Condition; import java.util.concurrent.locks.Lock; --- old/src/java.logging/share/classes/java/util/logging/Level.java 2018-11-01 19:09:01.000000000 -0700 +++ new/src/java.logging/share/classes/java/util/logging/Level.java 2018-11-01 19:09:00.000000000 -0700 @@ -40,8 +40,8 @@ import java.util.ResourceBundle; import java.util.function.Function; import jdk.internal.loader.ClassLoaderValue; -import jdk.internal.misc.JavaUtilResourceBundleAccess; -import jdk.internal.misc.SharedSecrets; +import jdk.internal.access.JavaUtilResourceBundleAccess; +import jdk.internal.access.SharedSecrets; /** * The Level class defines a set of standard logging levels that --- old/src/java.logging/share/classes/java/util/logging/LogManager.java 2018-11-01 19:09:02.000000000 -0700 +++ new/src/java.logging/share/classes/java/util/logging/LogManager.java 2018-11-01 19:09:02.000000000 -0700 @@ -39,8 +39,8 @@ import java.util.function.Predicate; import java.util.stream.Collectors; import java.util.stream.Stream; -import jdk.internal.misc.JavaAWTAccess; -import jdk.internal.misc.SharedSecrets; +import jdk.internal.access.JavaAWTAccess; +import jdk.internal.access.SharedSecrets; import sun.util.logging.internal.LoggingProviderImpl; import static jdk.internal.logger.DefaultLoggerFinder.isSystem; --- old/src/java.logging/share/classes/java/util/logging/Logger.java 2018-11-01 19:09:04.000000000 -0700 +++ new/src/java.logging/share/classes/java/util/logging/Logger.java 2018-11-01 19:09:03.000000000 -0700 @@ -37,8 +37,8 @@ import java.util.concurrent.CopyOnWriteArrayList; import java.util.function.Supplier; -import jdk.internal.misc.JavaUtilResourceBundleAccess; -import jdk.internal.misc.SharedSecrets; +import jdk.internal.access.JavaUtilResourceBundleAccess; +import jdk.internal.access.SharedSecrets; import jdk.internal.reflect.CallerSensitive; import jdk.internal.reflect.Reflection; import static jdk.internal.logger.DefaultLoggerFinder.isSystem; --- old/src/java.management/share/classes/com/sun/jmx/mbeanserver/JavaBeansAccessor.java 2018-11-01 19:09:05.000000000 -0700 +++ new/src/java.management/share/classes/com/sun/jmx/mbeanserver/JavaBeansAccessor.java 2018-11-01 19:09:04.000000000 -0700 @@ -26,8 +26,8 @@ import java.lang.reflect.Constructor; import java.lang.reflect.Method; -import jdk.internal.misc.JavaBeansAccess; -import jdk.internal.misc.SharedSecrets; +import jdk.internal.access.JavaBeansAccess; +import jdk.internal.access.SharedSecrets; /** * A centralized place for gaining access to java.beans related functionality - --- old/src/java.management/share/classes/javax/management/modelmbean/RequiredModelMBean.java 2018-11-01 19:09:06.000000000 -0700 +++ new/src/java.management/share/classes/javax/management/modelmbean/RequiredModelMBean.java 2018-11-01 19:09:06.000000000 -0700 @@ -80,8 +80,8 @@ import javax.management.RuntimeOperationsException; import javax.management.ServiceNotFoundException; import javax.management.loading.ClassLoaderRepository; -import jdk.internal.misc.JavaSecurityAccess; -import jdk.internal.misc.SharedSecrets; +import jdk.internal.access.JavaSecurityAccess; +import jdk.internal.access.SharedSecrets; import sun.reflect.misc.MethodUtil; import sun.reflect.misc.ReflectUtil; --- old/src/java.management/share/classes/javax/management/openmbean/TabularDataSupport.java 2018-11-01 19:09:07.000000000 -0700 +++ new/src/java.management/share/classes/javax/management/openmbean/TabularDataSupport.java 2018-11-01 19:09:07.000000000 -0700 @@ -45,7 +45,7 @@ import java.util.List; import java.util.Map; import java.util.Set; -import jdk.internal.misc.SharedSecrets; +import jdk.internal.access.SharedSecrets; // jmx import // --- old/src/java.management/share/classes/sun/management/ManagementFactoryHelper.java 2018-11-01 19:09:09.000000000 -0700 +++ new/src/java.management/share/classes/sun/management/ManagementFactoryHelper.java 2018-11-01 19:09:08.000000000 -0700 @@ -39,8 +39,8 @@ import java.security.PrivilegedActionException; import java.security.PrivilegedExceptionAction; -import jdk.internal.misc.JavaNioAccess; -import jdk.internal.misc.SharedSecrets; +import jdk.internal.access.JavaNioAccess; +import jdk.internal.access.SharedSecrets; import java.util.ArrayList; import java.util.List; --- old/src/java.naming/share/classes/com/sun/jndi/ldap/VersionHelper.java 2018-11-01 19:09:10.000000000 -0700 +++ new/src/java.naming/share/classes/com/sun/jndi/ldap/VersionHelper.java 2018-11-01 19:09:09.000000000 -0700 @@ -25,7 +25,7 @@ package com.sun.jndi.ldap; -import jdk.internal.misc.SharedSecrets; +import jdk.internal.access.SharedSecrets; import java.net.MalformedURLException; import java.net.URL; --- old/src/java.rmi/share/classes/sun/rmi/registry/RegistryImpl.java 2018-11-01 19:09:11.000000000 -0700 +++ new/src/java.rmi/share/classes/sun/rmi/registry/RegistryImpl.java 2018-11-01 19:09:11.000000000 -0700 @@ -57,7 +57,7 @@ import java.security.ProtectionDomain; import java.text.MessageFormat; -import jdk.internal.misc.SharedSecrets; +import jdk.internal.access.SharedSecrets; import sun.rmi.runtime.Log; import sun.rmi.server.UnicastRef; import sun.rmi.server.UnicastServerRef; --- old/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/ConstantPoolSubstitutionsTests.java 2018-11-01 19:09:13.000000000 -0700 +++ new/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/ConstantPoolSubstitutionsTests.java 2018-11-01 19:09:12.000000000 -0700 @@ -75,7 +75,8 @@ } private static Object getConstantPoolForObject() { - String miscPackage = Java8OrEarlier ? "sun.misc" : "jdk.internal.misc"; + String miscPackage = Java8OrEarlier ? "sun.misc" + : (Java11OrEarlier ? "jdk.internal.misc" : "jdk.internal.access"); try { Class sharedSecretsClass = Class.forName(miscPackage + ".SharedSecrets"); Class javaLangAccessClass = Class.forName(miscPackage + ".JavaLangAccess"); @@ -114,7 +115,10 @@ Object javaBaseModule = JLModule.fromClass(String.class); Object cModule = JLModule.fromClass(c); uncheckedAddExports(javaBaseModule, "jdk.internal.reflect", cModule); - uncheckedAddExports(javaBaseModule, "jdk.internal.misc", cModule); + if (Java11OrEarlier) + uncheckedAddExports(javaBaseModule, "jdk.internal.misc", cModule); + else + uncheckedAddExports(javaBaseModule, "jdk.internal.access", cModule); } } --- old/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.test/src/org/graalvm/compiler/test/GraalTest.java 2018-11-01 19:09:14.000000000 -0700 +++ new/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.test/src/org/graalvm/compiler/test/GraalTest.java 2018-11-01 19:09:13.000000000 -0700 @@ -72,6 +72,7 @@ } public static final boolean Java8OrEarlier = GraalServices.Java8OrEarlier; + public static final boolean Java11OrEarlier = GraalServices.Java11OrEarlier; protected Method getMethod(String methodName) { return getMethod(getClass(), methodName); --- old/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/GenerateJLIClassesPlugin.java 2018-11-01 19:09:15.000000000 -0700 +++ new/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/GenerateJLIClassesPlugin.java 2018-11-01 19:09:14.000000000 -0700 @@ -30,18 +30,16 @@ import java.io.InputStream; import java.io.InputStreamReader; import java.lang.invoke.MethodType; -import java.lang.module.ModuleDescriptor; import java.nio.file.Files; import java.util.EnumSet; import java.util.Map; -import java.util.Optional; import java.util.Set; import java.util.TreeMap; import java.util.TreeSet; import java.util.stream.Collectors; import java.util.stream.Stream; -import jdk.internal.misc.SharedSecrets; -import jdk.internal.misc.JavaLangInvokeAccess; +import jdk.internal.access.SharedSecrets; +import jdk.internal.access.JavaLangInvokeAccess; import jdk.tools.jlink.plugin.ResourcePoolEntry; import jdk.tools.jlink.plugin.PluginException; import jdk.tools.jlink.plugin.ResourcePool; --- old/src/jdk.net/share/classes/jdk/net/ExtendedSocketOptions.java 2018-11-01 19:09:16.000000000 -0700 +++ new/src/jdk.net/share/classes/jdk/net/ExtendedSocketOptions.java 2018-11-01 19:09:16.000000000 -0700 @@ -33,8 +33,8 @@ import java.util.Collections; import java.util.HashSet; import java.util.Set; -import jdk.internal.misc.JavaIOFileDescriptorAccess; -import jdk.internal.misc.SharedSecrets; +import jdk.internal.access.JavaIOFileDescriptorAccess; +import jdk.internal.access.SharedSecrets; /** * Defines extended socket options, beyond those defined in --- old/src/jdk.unsupported/share/classes/com/sun/nio/file/ExtendedCopyOption.java 2018-11-01 19:09:18.000000000 -0700 +++ new/src/jdk.unsupported/share/classes/com/sun/nio/file/ExtendedCopyOption.java 2018-11-01 19:09:17.000000000 -0700 @@ -26,7 +26,7 @@ package com.sun.nio.file; import java.nio.file.CopyOption; -import sun.nio.fs.ExtendedOptions; +import jdk.internal.misc.FileSystemOption; /** * Defines extended copy options supported on some platforms @@ -40,9 +40,9 @@ * The copy may be interrupted by the {@link Thread#interrupt interrupt} * method. */ - INTERRUPTIBLE(ExtendedOptions.INTERRUPTIBLE); + INTERRUPTIBLE(FileSystemOption.INTERRUPTIBLE); - ExtendedCopyOption(ExtendedOptions.InternalOption option) { + ExtendedCopyOption(FileSystemOption option) { option.register(this); } } --- old/src/jdk.unsupported/share/classes/com/sun/nio/file/ExtendedOpenOption.java 2018-11-01 19:09:19.000000000 -0700 +++ new/src/jdk.unsupported/share/classes/com/sun/nio/file/ExtendedOpenOption.java 2018-11-01 19:09:18.000000000 -0700 @@ -26,7 +26,7 @@ package com.sun.nio.file; import java.nio.file.OpenOption; -import sun.nio.fs.ExtendedOptions; +import jdk.internal.misc.FileSystemOption; /** * Defines extended open options supported on some platforms @@ -39,15 +39,15 @@ /** * Prevent operations on the file that request read access. */ - NOSHARE_READ(ExtendedOptions.NOSHARE_READ), + NOSHARE_READ(FileSystemOption.NOSHARE_READ), /** * Prevent operations on the file that request write access. */ - NOSHARE_WRITE(ExtendedOptions.NOSHARE_WRITE), + NOSHARE_WRITE(FileSystemOption.NOSHARE_WRITE), /** * Prevent operations on the file that request delete access. */ - NOSHARE_DELETE(ExtendedOptions.NOSHARE_DELETE), + NOSHARE_DELETE(FileSystemOption.NOSHARE_DELETE), /** * Requires that direct I/O be used for read or write access. @@ -69,9 +69,9 @@ * * @since 10 */ - DIRECT(ExtendedOptions.DIRECT); + DIRECT(FileSystemOption.DIRECT); - ExtendedOpenOption(ExtendedOptions.InternalOption option) { + ExtendedOpenOption(FileSystemOption option) { option.register(this); } } --- old/src/jdk.unsupported/share/classes/com/sun/nio/file/ExtendedWatchEventModifier.java 2018-11-01 19:09:20.000000000 -0700 +++ new/src/jdk.unsupported/share/classes/com/sun/nio/file/ExtendedWatchEventModifier.java 2018-11-01 19:09:19.000000000 -0700 @@ -26,7 +26,7 @@ package com.sun.nio.file; import java.nio.file.WatchEvent.Modifier; -import sun.nio.fs.ExtendedOptions; +import jdk.internal.misc.FileSystemOption; /** * Defines extended watch event modifiers supported on some platforms @@ -40,9 +40,9 @@ /** * Register a file tree instead of a single directory. */ - FILE_TREE(ExtendedOptions.FILE_TREE); + FILE_TREE(FileSystemOption.FILE_TREE); - ExtendedWatchEventModifier(ExtendedOptions.InternalOption option) { + ExtendedWatchEventModifier(FileSystemOption option) { option.register(this); } } --- old/src/jdk.unsupported/share/classes/com/sun/nio/file/SensitivityWatchEventModifier.java 2018-11-01 19:09:21.000000000 -0700 +++ new/src/jdk.unsupported/share/classes/com/sun/nio/file/SensitivityWatchEventModifier.java 2018-11-01 19:09:21.000000000 -0700 @@ -26,7 +26,7 @@ package com.sun.nio.file; import java.nio.file.WatchEvent.Modifier; -import sun.nio.fs.ExtendedOptions; +import jdk.internal.misc.FileSystemOption; /** * Defines the sensitivity levels when registering objects with a @@ -39,15 +39,15 @@ /** * High sensitivity. */ - HIGH(ExtendedOptions.SENSITIVITY_HIGH, 2), + HIGH(FileSystemOption.SENSITIVITY_HIGH, 2), /** * Medium sensitivity. */ - MEDIUM(ExtendedOptions.SENSITIVITY_MEDIUM, 10), + MEDIUM(FileSystemOption.SENSITIVITY_MEDIUM, 10), /** * Low sensitivity. */ - LOW(ExtendedOptions.SENSITIVITY_LOW, 30); + LOW(FileSystemOption.SENSITIVITY_LOW, 30); /** * Returns the sensitivity in seconds. @@ -57,7 +57,7 @@ } private final int sensitivity; - private SensitivityWatchEventModifier(ExtendedOptions.InternalOption option, + private SensitivityWatchEventModifier(FileSystemOption option, int sensitivity) { this.sensitivity = sensitivity; option.register(this, sensitivity); --- old/src/jdk.unsupported/share/classes/sun/misc/Unsafe.java 2018-11-01 19:09:22.000000000 -0700 +++ new/src/jdk.unsupported/share/classes/sun/misc/Unsafe.java 2018-11-01 19:09:22.000000000 -0700 @@ -27,10 +27,8 @@ import jdk.internal.vm.annotation.ForceInline; import jdk.internal.misc.VM; -import jdk.internal.ref.Cleaner; import jdk.internal.reflect.CallerSensitive; import jdk.internal.reflect.Reflection; -import sun.nio.ch.DirectBuffer; import java.lang.reflect.Field; import java.util.Set; @@ -1234,13 +1232,6 @@ if (!directBuffer.isDirect()) throw new IllegalArgumentException("buffer is non-direct"); - DirectBuffer db = (DirectBuffer)directBuffer; - if (db.attachment() != null) - throw new IllegalArgumentException("duplicate or slice"); - - Cleaner cleaner = db.cleaner(); - if (cleaner != null) { - cleaner.clean(); - } + theInternalUnsafe.invokeCleaner(directBuffer); } } --- old/test/hotspot/jtreg/applications/ctw/modules/generate.bash 2018-11-01 19:09:23.000000000 -0700 +++ new/test/hotspot/jtreg/applications/ctw/modules/generate.bash 2018-11-01 19:09:23.000000000 -0700 @@ -1,6 +1,6 @@ #!/bin/bash # -# Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2017, 2018, 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 @@ -30,7 +30,7 @@ echo creating $file for $module... cat > $file < argsList = new ArrayList(); argsList.add(classPath); argsList.add(bootclasspath); - argsList.add("--add-exports=java.base/jdk.internal.misc=ALL-UNNAMED"); + argsList.add("--add-exports=java.base/jdk.internal.access=ALL-UNNAMED"); argsList.add("EmptyClassHelper"); // case 1: load class in bootclasspath using app loader --- old/test/hotspot/jtreg/runtime/appcds/test-classes/EmptyClassHelper.java 2018-11-01 19:11:03.000000000 -0700 +++ new/test/hotspot/jtreg/runtime/appcds/test-classes/EmptyClassHelper.java 2018-11-01 19:11:02.000000000 -0700 @@ -23,9 +23,10 @@ */ import java.lang.*; -import java.lang.reflect.*; -import jdk.internal.misc.JavaLangAccess; -import jdk.internal.misc.SharedSecrets; + +import java.lang.reflect.Method; +import jdk.internal.access.JavaLangAccess; +import jdk.internal.access.SharedSecrets; class EmptyClassHelper { static final JavaLangAccess jla = SharedSecrets.getJavaLangAccess(); --- old/test/hotspot/jtreg/testlibrary/ctw/src/sun/hotspot/tools/ctw/Compiler.java 2018-11-01 19:11:04.000000000 -0700 +++ new/test/hotspot/jtreg/testlibrary/ctw/src/sun/hotspot/tools/ctw/Compiler.java 2018-11-01 19:11:04.000000000 -0700 @@ -23,7 +23,7 @@ package sun.hotspot.tools.ctw; -import jdk.internal.misc.SharedSecrets; +import jdk.internal.access.SharedSecrets; import jdk.internal.misc.Unsafe; import jdk.internal.reflect.ConstantPool; import sun.hotspot.WhiteBox; --- old/test/hotspot/jtreg/testlibrary_tests/ctw/ClassesDirTest.java 2018-11-01 19:11:05.000000000 -0700 +++ new/test/hotspot/jtreg/testlibrary_tests/ctw/ClassesDirTest.java 2018-11-01 19:11:05.000000000 -0700 @@ -25,7 +25,8 @@ * @test * @bug 8012447 * @library /test/lib /testlibrary/ctw/src - * @modules java.base/jdk.internal.jimage + * @modules java.base/jdk.internal.access + * java.base/jdk.internal.jimage * java.base/jdk.internal.misc * java.base/jdk.internal.reflect * java.management --- old/test/hotspot/jtreg/testlibrary_tests/ctw/ClassesListTest.java 2018-11-01 19:11:06.000000000 -0700 +++ new/test/hotspot/jtreg/testlibrary_tests/ctw/ClassesListTest.java 2018-11-01 19:11:06.000000000 -0700 @@ -25,7 +25,8 @@ * @test * @bug 8012447 * @library /test/lib /testlibrary/ctw/src - * @modules java.base/jdk.internal.jimage + * @modules java.base/jdk.internal.access + * java.base/jdk.internal.jimage * java.base/jdk.internal.misc * java.base/jdk.internal.reflect * java.management --- old/test/hotspot/jtreg/testlibrary_tests/ctw/CtwTest.java 2018-11-01 19:11:08.000000000 -0700 +++ new/test/hotspot/jtreg/testlibrary_tests/ctw/CtwTest.java 2018-11-01 19:11:07.000000000 -0700 @@ -49,6 +49,7 @@ "-XX:+UnlockDiagnosticVMOptions", "-XX:+WhiteBoxAPI", "-Dsun.hotspot.tools.ctw.logfile=" + LOG_FILE, + "--add-exports", "java.base/jdk.internal.access=ALL-UNNAMED", "--add-exports", "java.base/jdk.internal.jimage=ALL-UNNAMED", "--add-exports", "java.base/jdk.internal.misc=ALL-UNNAMED", "--add-exports", "java.base/jdk.internal.reflect=ALL-UNNAMED", --- old/test/hotspot/jtreg/testlibrary_tests/ctw/JarDirTest.java 2018-11-01 19:11:09.000000000 -0700 +++ new/test/hotspot/jtreg/testlibrary_tests/ctw/JarDirTest.java 2018-11-01 19:11:08.000000000 -0700 @@ -25,7 +25,8 @@ * @test * @bug 8012447 * @library /test/lib /testlibrary/ctw/src - * @modules java.base/jdk.internal.jimage + * @modules java.base/jdk.internal.access + * java.base/jdk.internal.jimage * java.base/jdk.internal.misc * java.base/jdk.internal.reflect * java.compiler --- old/test/hotspot/jtreg/testlibrary_tests/ctw/JarsTest.java 2018-11-01 19:11:10.000000000 -0700 +++ new/test/hotspot/jtreg/testlibrary_tests/ctw/JarsTest.java 2018-11-01 19:11:10.000000000 -0700 @@ -25,7 +25,8 @@ * @test * @bug 8012447 * @library /test/lib /testlibrary/ctw/src - * @modules java.base/jdk.internal.jimage + * @modules java.base/jdk.internal.access + * java.base/jdk.internal.jimage * java.base/jdk.internal.misc * java.base/jdk.internal.reflect * java.compiler --- old/test/jdk/java/io/Serializable/serialFilter/CheckArrayTest.java 2018-11-01 19:11:11.000000000 -0700 +++ new/test/jdk/java/io/Serializable/serialFilter/CheckArrayTest.java 2018-11-01 19:11:11.000000000 -0700 @@ -28,11 +28,8 @@ import java.io.ObjectInputStream; import java.io.InvalidClassException; -import java.util.Hashtable; +import jdk.internal.access.SharedSecrets; -import jdk.internal.misc.SharedSecrets; - -import org.testng.annotations.BeforeClass; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; import org.testng.Assert; @@ -40,7 +37,7 @@ /* @test * @build CheckArrayTest SerialFilterTest * @bug 8203368 - * @modules java.base/jdk.internal.misc + * @modules java.base/jdk.internal.access * @run testng CheckArrayTest * * @summary Test the SharedSecret access to ObjectInputStream.checkArray works --- old/test/jdk/java/lang/ModuleLayer/BasicLayerTest.java 2018-11-01 19:11:12.000000000 -0700 +++ new/test/jdk/java/lang/ModuleLayer/BasicLayerTest.java 2018-11-01 19:11:12.000000000 -0700 @@ -24,7 +24,7 @@ /** * @test * @library /test/lib - * @modules java.base/jdk.internal.misc + * @modules java.base/jdk.internal.access * @build BasicLayerTest * jdk.test.lib.util.ModuleUtils * @compile layertest/Test.java @@ -38,13 +38,12 @@ import java.lang.module.ModuleFinder; import java.util.HashMap; import java.util.Map; -import java.util.Optional; import java.util.Set; import java.util.stream.Collectors; import jdk.test.lib.util.ModuleUtils; -import jdk.internal.misc.SharedSecrets; +import jdk.internal.access.SharedSecrets; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; --- old/test/jdk/java/lang/module/ConfigurationTest.java 2018-11-01 19:11:14.000000000 -0700 +++ new/test/jdk/java/lang/module/ConfigurationTest.java 2018-11-01 19:11:13.000000000 -0700 @@ -24,7 +24,7 @@ /** * @test * @library /test/lib - * @modules java.base/jdk.internal.misc + * @modules java.base/jdk.internal.access * java.base/jdk.internal.module * @build ConfigurationTest * jdk.test.lib.util.ModuleUtils @@ -45,12 +45,11 @@ import java.nio.file.Path; import java.nio.file.Paths; import java.util.List; -import java.util.Optional; import java.util.Set; import jdk.test.lib.util.ModuleUtils; -import jdk.internal.misc.SharedSecrets; +import jdk.internal.access.SharedSecrets; import jdk.internal.module.ModuleInfoWriter; import jdk.internal.module.ModuleTarget; import org.testng.annotations.DataProvider; --- old/test/jdk/java/lang/module/ModuleDescriptorTest.java 2018-11-01 19:11:15.000000000 -0700 +++ new/test/jdk/java/lang/module/ModuleDescriptorTest.java 2018-11-01 19:11:14.000000000 -0700 @@ -23,8 +23,8 @@ /** * @test - * @modules java.base/jdk.internal.module - * java.base/jdk.internal.misc + * @modules java.base/jdk.internal.access + * java.base/jdk.internal.module * @run testng ModuleDescriptorTest * @summary Basic test for java.lang.module.ModuleDescriptor and its builder */ @@ -49,14 +49,13 @@ import java.util.Iterator; import java.util.List; import java.util.Objects; -import java.util.Optional; import java.util.Set; import java.util.stream.Collectors; import static java.lang.module.ModuleDescriptor.Requires.Modifier.*; -import jdk.internal.misc.JavaLangModuleAccess; -import jdk.internal.misc.SharedSecrets; +import jdk.internal.access.JavaLangModuleAccess; +import jdk.internal.access.SharedSecrets; import jdk.internal.module.ModuleInfoWriter; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; --- old/test/jdk/java/lang/module/ModuleNamesTest.java 2018-11-01 19:11:16.000000000 -0700 +++ new/test/jdk/java/lang/module/ModuleNamesTest.java 2018-11-01 19:11:16.000000000 -0700 @@ -23,7 +23,7 @@ /** * @test - * @modules java.base/jdk.internal.misc + * @modules java.base/jdk.internal.access * java.base/jdk.internal.module * @run testng ModuleNamesTest * @summary Basic test of reading a module-info.class with module names that @@ -41,7 +41,7 @@ import java.util.Optional; import java.util.Set; -import jdk.internal.misc.SharedSecrets; +import jdk.internal.access.SharedSecrets; import jdk.internal.module.ModuleInfoWriter; import org.testng.annotations.DataProvider; --- old/test/jdk/java/net/InetAddress/getOriginalHostName.java 2018-11-01 19:11:18.000000000 -0700 +++ new/test/jdk/java/net/InetAddress/getOriginalHostName.java 2018-11-01 19:11:17.000000000 -0700 @@ -25,14 +25,13 @@ * @test * @bug 8133196 * @summary test functionality of getOriginalHostName(InetAddress) - * @modules java.base/jdk.internal.misc + * @modules java.base/jdk.internal.access */ -import java.io.*; import java.net.InetAddress; -import jdk.internal.misc.JavaNetInetAddressAccess; -import jdk.internal.misc.SharedSecrets; +import jdk.internal.access.JavaNetInetAddressAccess; +import jdk.internal.access.SharedSecrets; public class getOriginalHostName { --- old/test/jdk/java/security/ProtectionDomain/PreserveCombinerTest.java 2018-11-01 19:11:20.000000000 -0700 +++ new/test/jdk/java/security/ProtectionDomain/PreserveCombinerTest.java 2018-11-01 19:11:19.000000000 -0700 @@ -26,7 +26,7 @@ import java.security.DomainCombiner; import java.security.PrivilegedAction; import java.security.ProtectionDomain; -import jdk.internal.misc.SharedSecrets; +import jdk.internal.access.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/jdk.internal.misc + * @modules java.base/jdk.internal.access */ public class PreserveCombinerTest { --- old/test/jdk/java/util/logging/LogManagerAppContextDeadlock.java 2018-11-01 19:11:21.000000000 -0700 +++ new/test/jdk/java/util/logging/LogManagerAppContextDeadlock.java 2018-11-01 19:11:20.000000000 -0700 @@ -35,15 +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; +import jdk.internal.access.JavaAWTAccess; +import jdk.internal.access.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/jdk.internal.misc + * @modules java.base/jdk.internal.access * java.logging * java.management * @run main/othervm LogManagerAppContextDeadlock UNSECURE @@ -349,7 +349,7 @@ // FileHandlers because we're passing invalid parameters // which will make the creation fail... permissions = new Permissions(); - permissions.add(new RuntimePermission("accessClassInPackage.jdk.internal.misc")); + permissions.add(new RuntimePermission("accessClassInPackage.jdk.internal.access")); // these are used for configuring the test itself... allPermissions = new Permissions(); --- old/test/jdk/java/util/logging/RootLogger/RootLevelInConfigFile.java 2018-11-01 19:11:22.000000000 -0700 +++ new/test/jdk/java/util/logging/RootLogger/RootLevelInConfigFile.java 2018-11-01 19:11:22.000000000 -0700 @@ -34,15 +34,15 @@ import java.util.logging.LogManager; import java.util.logging.Logger; import java.util.logging.LoggingPermission; -import jdk.internal.misc.JavaAWTAccess; -import jdk.internal.misc.SharedSecrets; +import jdk.internal.access.JavaAWTAccess; +import jdk.internal.access.SharedSecrets; /** * @test * @bug 8030850 * @summary Tests that setting .level=FINEST for the root logger in logging * configuration file does work. - * @modules java.base/jdk.internal.misc + * @modules java.base/jdk.internal.access * java.logging * @run main/othervm RootLevelInConfigFile * @@ -182,7 +182,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.jdk.internal.misc")); + perms.add(new RuntimePermission("accessClassInPackage.jdk.internal.access")); } @Override --- old/test/jdk/java/util/logging/TestAppletLoggerContext.java 2018-11-01 19:11:23.000000000 -0700 +++ new/test/jdk/java/util/logging/TestAppletLoggerContext.java 2018-11-01 19:11:23.000000000 -0700 @@ -33,8 +33,8 @@ import java.util.logging.LogManager; import java.util.logging.Logger; import java.util.logging.LoggingPermission; -import jdk.internal.misc.JavaAWTAccess; -import jdk.internal.misc.SharedSecrets; +import jdk.internal.access.JavaAWTAccess; +import jdk.internal.access.SharedSecrets; /* * @test @@ -42,7 +42,7 @@ * @summary NPE when using Logger.getAnonymousLogger or * LogManager.getLogManager().getLogger * - * @modules java.base/jdk.internal.misc + * @modules java.base/jdk.internal.access * java.logging * @run main/othervm -Dtest.security=off TestAppletLoggerContext LoadingApplet * @run main/othervm -Dtest.security=on TestAppletLoggerContext LoadingApplet --- old/test/jdk/java/util/logging/TestGetLoggerNPE.java 2018-11-01 19:11:25.000000000 -0700 +++ new/test/jdk/java/util/logging/TestGetLoggerNPE.java 2018-11-01 19:11:24.000000000 -0700 @@ -26,8 +26,8 @@ import java.security.ProtectionDomain; import java.util.logging.LogManager; import java.util.logging.Logger; -import jdk.internal.misc.JavaAWTAccess; -import jdk.internal.misc.SharedSecrets; +import jdk.internal.access.JavaAWTAccess; +import jdk.internal.access.SharedSecrets; /* * @test @@ -35,7 +35,7 @@ * * @summary NPE with logging while launching webstart * - * @modules java.base/jdk.internal.misc + * @modules java.base/jdk.internal.access * java.logging * @build TestGetLoggerNPE * @run main/othervm TestGetLoggerNPE getLogger --- old/test/jdk/jdk/internal/reflect/constantPool/ConstantPoolTest.java 2018-11-01 19:11:26.000000000 -0700 +++ new/test/jdk/jdk/internal/reflect/constantPool/ConstantPoolTest.java 2018-11-01 19:11:25.000000000 -0700 @@ -25,7 +25,7 @@ * @test * @bug 8141615 * @summary Tests new public methods at ConstantPool - * @modules java.base/jdk.internal.misc + * @modules java.base/jdk.internal.access * java.base/jdk.internal.reflect * @library /test/lib * @compile ConstantPoolTestDummy.jasm @@ -36,9 +36,9 @@ import java.util.HashMap; import java.util.Map; -import jdk.internal.misc.SharedSecrets; -import jdk.test.lib.Asserts; +import jdk.internal.access.SharedSecrets; import jdk.internal.reflect.ConstantPool; +import jdk.test.lib.Asserts; public class ConstantPoolTest { --- old/test/jdk/tools/jar/modularJar/src/bar/jdk/test/bar/Bar.java 2018-11-01 19:11:27.000000000 -0700 +++ new/test/jdk/tools/jar/modularJar/src/bar/jdk/test/bar/Bar.java 2018-11-01 19:11:27.000000000 -0700 @@ -32,8 +32,7 @@ import java.util.StringJoiner; import java.util.HashSet; import java.util.Set; -import jdk.internal.misc.SharedSecrets; -import jdk.internal.misc.JavaLangModuleAccess; + import jdk.internal.module.ModuleHashes; import jdk.internal.module.ModuleReferenceImpl; import jdk.test.bar.internal.Message; --- old/test/jdk/tools/jlink/plugins/SystemModuleDescriptors/SystemModulesTest.java 2018-11-01 19:11:28.000000000 -0700 +++ new/test/jdk/tools/jlink/plugins/SystemModuleDescriptors/SystemModulesTest.java 2018-11-01 19:11:28.000000000 -0700 @@ -34,15 +34,15 @@ import java.util.Map; import java.util.Set; -import jdk.internal.misc.JavaLangModuleAccess; -import jdk.internal.misc.SharedSecrets; +import jdk.internal.access.JavaLangModuleAccess; +import jdk.internal.access.SharedSecrets; import org.testng.annotations.Test; import static org.testng.Assert.*; /** * @test * @bug 8142968 8173381 - * @modules java.base/jdk.internal.misc + * @modules java.base/jdk.internal.access * @modules java.base/jdk.internal.module * @modules java.base/jdk.internal.org.objectweb.asm * @build ModuleTargetHelper --- old/src/java.base/share/classes/jdk/internal/misc/JavaAWTAccess.java 2018-11-01 19:11:30.000000000 -0700 +++ /dev/null 2018-11-01 19:11:30.000000000 -0700 @@ -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 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 2018-11-01 19:11:30.000000000 -0700 +++ new/src/java.base/share/classes/jdk/internal/access/JavaAWTAccess.java 2018-11-01 19:11:29.000000000 -0700 @@ -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.access; + +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(); +} --- old/src/java.base/share/classes/jdk/internal/misc/JavaAWTFontAccess.java 2018-11-01 19:11:31.000000000 -0700 +++ /dev/null 2018-11-01 19:11:31.000000000 -0700 @@ -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 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 2018-11-01 19:11:31.000000000 -0700 +++ new/src/java.base/share/classes/jdk/internal/access/JavaAWTFontAccess.java 2018-11-01 19:11:30.000000000 -0700 @@ -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.access; + +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); +} --- old/src/java.base/share/classes/jdk/internal/misc/JavaBeansAccess.java 2018-11-01 19:11:32.000000000 -0700 +++ /dev/null 2018-11-01 19:11:32.000000000 -0700 @@ -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 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 value attribute of the associated - * @ConstructorProperties annotation if that is present. - * @param ctr The constructor to extract the annotation value from - * @return The {@code value} attribute of the @ConstructorProperties - * 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 2018-11-01 19:11:32.000000000 -0700 +++ new/src/java.base/share/classes/jdk/internal/access/JavaBeansAccess.java 2018-11-01 19:11:32.000000000 -0700 @@ -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.access; + +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 value attribute of the associated + * @ConstructorProperties annotation if that is present. + * @param ctr The constructor to extract the annotation value from + * @return The {@code value} attribute of the @ConstructorProperties + * annotation or {@code null} if the constructor is not annotated by + * this annotation or the annotation is not accessible. + */ + String[] getConstructorPropertiesValue(Constructor ctr); +} --- old/src/java.base/share/classes/jdk/internal/misc/JavaIOAccess.java 2018-11-01 19:11:34.000000000 -0700 +++ /dev/null 2018-11-01 19:11:34.000000000 -0700 @@ -1,34 +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 jdk.internal.misc; - -import java.io.Console; -import java.nio.charset.Charset; - -public interface JavaIOAccess { - public Console console(); - public Charset charset(); -} --- /dev/null 2018-11-01 19:11:34.000000000 -0700 +++ new/src/java.base/share/classes/jdk/internal/access/JavaIOAccess.java 2018-11-01 19:11:33.000000000 -0700 @@ -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.access; + +import java.io.Console; +import java.nio.charset.Charset; + +public interface JavaIOAccess { + public Console console(); + public Charset charset(); +} --- old/src/java.base/share/classes/jdk/internal/misc/JavaIOFileDescriptorAccess.java 2018-11-01 19:11:35.000000000 -0700 +++ /dev/null 2018-11-01 19:11:35.000000000 -0700 @@ -1,49 +0,0 @@ -/* - * Copyright (c) 2007, 2018, 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; -import java.io.IOException; - -import jdk.internal.ref.PhantomCleanable; - -/* - * @author Chris Hegarty - */ - -public interface JavaIOFileDescriptorAccess { - public void set(FileDescriptor fdo, int fd); - public int get(FileDescriptor fdo); - public void setAppend(FileDescriptor fdo, boolean append); - public boolean getAppend(FileDescriptor fdo); - public void close(FileDescriptor fdo) throws IOException; - public void registerCleanup(FileDescriptor fdo); - public void registerCleanup(FileDescriptor fdo, PhantomCleanable cleanable); - public void unregisterCleanup(FileDescriptor fdo); - - // Only valid on Windows - public void setHandle(FileDescriptor fdo, long handle); - public long getHandle(FileDescriptor fdo); -} --- /dev/null 2018-11-01 19:11:35.000000000 -0700 +++ new/src/java.base/share/classes/jdk/internal/access/JavaIOFileDescriptorAccess.java 2018-11-01 19:11:34.000000000 -0700 @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2007, 2018, 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.access; + +import java.io.FileDescriptor; +import java.io.IOException; + +import jdk.internal.ref.PhantomCleanable; + +/* + * @author Chris Hegarty + */ + +public interface JavaIOFileDescriptorAccess { + public void set(FileDescriptor fdo, int fd); + public int get(FileDescriptor fdo); + public void setAppend(FileDescriptor fdo, boolean append); + public boolean getAppend(FileDescriptor fdo); + public void close(FileDescriptor fdo) throws IOException; + public void registerCleanup(FileDescriptor fdo); + public void registerCleanup(FileDescriptor fdo, PhantomCleanable cleanable); + public void unregisterCleanup(FileDescriptor fdo); + + // Only valid on Windows + public void setHandle(FileDescriptor fdo, long handle); + public long getHandle(FileDescriptor fdo); +} --- old/src/java.base/share/classes/jdk/internal/misc/JavaIOFilePermissionAccess.java 2018-11-01 19:11:36.000000000 -0700 +++ /dev/null 2018-11-01 19:11:36.000000000 -0700 @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2016, 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.FilePermission; - -public interface JavaIOFilePermissionAccess { - - /** - * Returns a new FilePermission plus an alternative path. - * - * @param input the input - * @return the new FilePermission plus the alt path (as npath2) - * or the input itself if no alt path is available. - */ - FilePermission newPermPlusAltPath(FilePermission input); - - /** - * Returns a new FilePermission using an alternative path. - * - * @param input the input - * @return the new FilePermission using the alt path (as npath) - * or null if no alt path is available - */ - FilePermission newPermUsingAltPath(FilePermission input); -} --- /dev/null 2018-11-01 19:11:36.000000000 -0700 +++ new/src/java.base/share/classes/jdk/internal/access/JavaIOFilePermissionAccess.java 2018-11-01 19:11:36.000000000 -0700 @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2016, 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.access; + +import java.io.FilePermission; + +public interface JavaIOFilePermissionAccess { + + /** + * Returns a new FilePermission plus an alternative path. + * + * @param input the input + * @return the new FilePermission plus the alt path (as npath2) + * or the input itself if no alt path is available. + */ + FilePermission newPermPlusAltPath(FilePermission input); + + /** + * Returns a new FilePermission using an alternative path. + * + * @param input the input + * @return the new FilePermission using the alt path (as npath) + * or null if no alt path is available + */ + FilePermission newPermUsingAltPath(FilePermission input); +} --- old/src/java.base/share/classes/jdk/internal/misc/JavaIORandomAccessFileAccess.java 2018-11-01 19:11:38.000000000 -0700 +++ /dev/null 2018-11-01 19:11:38.000000000 -0700 @@ -1,35 +0,0 @@ -/* - * Copyright (c) 2016, 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.File; -import java.io.IOException; -import java.io.RandomAccessFile; - -public interface JavaIORandomAccessFileAccess { - public RandomAccessFile openAndDelete(File file, String mode) - throws IOException; -} --- /dev/null 2018-11-01 19:11:38.000000000 -0700 +++ new/src/java.base/share/classes/jdk/internal/access/JavaIORandomAccessFileAccess.java 2018-11-01 19:11:37.000000000 -0700 @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2016, 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.access; + +import java.io.File; +import java.io.IOException; +import java.io.RandomAccessFile; + +public interface JavaIORandomAccessFileAccess { + public RandomAccessFile openAndDelete(File file, String mode) + throws IOException; +} --- old/src/java.base/share/classes/jdk/internal/misc/JavaLangAccess.java 2018-11-01 19:11:39.000000000 -0700 +++ /dev/null 2018-11-01 19:11:39.000000000 -0700 @@ -1,314 +0,0 @@ -/* - * Copyright (c) 2003, 2018, 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.module.ModuleDescriptor; -import java.lang.reflect.Executable; -import java.lang.reflect.Method; -import java.net.URI; -import java.nio.charset.CharacterCodingException; -import java.nio.charset.Charset; -import java.security.AccessControlContext; -import java.security.ProtectionDomain; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; -import java.util.stream.Stream; - -import jdk.internal.module.ServicesCatalog; -import jdk.internal.reflect.ConstantPool; -import sun.reflect.annotation.AnnotationType; -import sun.nio.ch.Interruptible; - -public interface JavaLangAccess { - - /** - * Returns the list of {@code Method} objects for the declared public - * methods of this class or interface that have the specified method name - * and parameter types. - */ - List getDeclaredPublicMethods(Class klass, String name, Class... parameterTypes); - - /** - * Return the constant pool for a class. - */ - ConstantPool getConstantPool(Class klass); - - /** - * Compare-And-Set 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, 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[] getEnumConstantsShared(Class klass); - - /** - * Set current thread's blocker field. - */ - void blockedOn(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 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; - - /** - * Returns the ConcurrentHashMap used as a storage for ClassLoaderValue(s) - * associated with the given class loader, creating it if it doesn't already exist. - */ - ConcurrentHashMap createOrGetClassLoaderValueMap(ClassLoader cl); - - /** - * Defines a class with the given name to a class loader. - */ - Class defineClass(ClassLoader cl, String name, byte[] b, ProtectionDomain pd, String source); - - /** - * Returns a class loaded by the bootstrap class loader. - */ - Class findBootstrapClassOrNull(ClassLoader cl, String name); - - /** - * Define a Package of the given name and module by the given class loader. - */ - Package definePackage(ClassLoader cl, String name, Module module); - - /** - * Invokes Long.fastUUID - */ - String fastUUID(long lsb, long msb); - - /** - * Record the non-exported packages of the modules in the given layer - */ - void addNonExportedPackages(ModuleLayer layer); - - /** - * Invalidate package access cache - */ - void invalidatePackageAccessCache(); - - /** - * Defines a new module to the Java virtual machine. The module - * is defined to the given class loader. - * - * The URI is for information purposes only, it can be {@code null}. - */ - Module defineModule(ClassLoader loader, ModuleDescriptor descriptor, URI uri); - - /** - * Defines the unnamed module for the given class loader. - */ - Module defineUnnamedModule(ClassLoader loader); - - /** - * Updates the readability so that module m1 reads m2. The new read edge - * does not result in a strong reference to m2 (m2 can be GC'ed). - * - * This method is the same as m1.addReads(m2) but without a permission check. - */ - void addReads(Module m1, Module m2); - - /** - * Updates module m to read all unnamed modules. - */ - void addReadsAllUnnamed(Module m); - - /** - * Updates module m1 to export a package to module m2. The export does - * not result in a strong reference to m2 (m2 can be GC'ed). - */ - void addExports(Module m1, String pkg, Module m2); - - /** - * Updates a module m to export a package to all unnamed modules. - */ - void addExportsToAllUnnamed(Module m, String pkg); - - /** - * Updates module m1 to open a package to module m2. Opening the - * package does not result in a strong reference to m2 (m2 can be GC'ed). - */ - void addOpens(Module m1, String pkg, Module m2); - - /** - * Updates module m to open a package to all unnamed modules. - */ - void addOpensToAllUnnamed(Module m, String pkg); - - /** - * Updates module m to open all packages returned by the given iterator. - */ - void addOpensToAllUnnamed(Module m, Iterator packages); - - /** - * Updates module m to use a service. - */ - void addUses(Module m, Class service); - - /** - * Returns true if module m reflectively exports a package to other - */ - boolean isReflectivelyExported(Module module, String pn, Module other); - - /** - * Returns true if module m reflectively opens a package to other - */ - boolean isReflectivelyOpened(Module module, String pn, Module other); - - /** - * Returns the ServicesCatalog for the given Layer. - */ - ServicesCatalog getServicesCatalog(ModuleLayer layer); - - /** - * Returns an ordered stream of layers. The first element is the - * given layer, the remaining elements are its parents, in DFS order. - */ - Stream layers(ModuleLayer layer); - - /** - * Returns a stream of the layers that have modules defined to the - * given class loader. - */ - Stream layers(ClassLoader loader); - - /** - * Constructs a new {@code String} by decoding the specified subarray of - * bytes using the specified {@linkplain java.nio.charset.Charset charset}. - * - * The caller of this method shall relinquish and transfer the ownership of - * the byte array to the callee since the later will not make a copy. - * - * @param bytes the byte array source - * @param cs the Charset - * @return the newly created string - * @throws CharacterCodingException for malformed or unmappable bytes - */ - String newStringNoRepl(byte[] bytes, Charset cs) throws CharacterCodingException; - - /** - * Encode the given string into a sequence of bytes using the specified Charset. - * - * This method avoids copying the String's internal representation if the input - * is ASCII. - * - * This method throws CharacterCodingException instead of replacing when - * malformed input or unmappable characters are encountered. - * - * @param s the string to encode - * @param cs the charset - * @return the encoded bytes - * @throws CharacterCodingException for malformed input or unmappable characters - */ - byte[] getBytesNoRepl(String s, Charset cs) throws CharacterCodingException; - - /** - * Returns a new string by decoding from the given utf8 bytes array. - * - * @param off the index of the first byte to decode - * @param len the number of bytes to decode - * @return the newly created string - * @throws IllegalArgumentException for malformed or unmappable bytes. - */ - String newStringUTF8NoRepl(byte[] bytes, int off, int len); - - /** - * Encode the given string into a sequence of bytes using utf8. - * - * @param s the string to encode - * @return the encoded bytes in utf8 - * @throws IllegalArgumentException for malformed surrogates - */ - byte[] getBytesUTF8NoRepl(String s); - - /** - * Set the cause of Throwable - * @param cause set t's cause to new value - */ - void setCause(Throwable t, Throwable cause); -} --- /dev/null 2018-11-01 19:11:39.000000000 -0700 +++ new/src/java.base/share/classes/jdk/internal/access/JavaLangAccess.java 2018-11-01 19:11:38.000000000 -0700 @@ -0,0 +1,314 @@ +/* + * Copyright (c) 2003, 2018, 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.access; + +import java.lang.annotation.Annotation; +import java.lang.module.ModuleDescriptor; +import java.lang.reflect.Executable; +import java.lang.reflect.Method; +import java.net.URI; +import java.nio.charset.CharacterCodingException; +import java.nio.charset.Charset; +import java.security.AccessControlContext; +import java.security.ProtectionDomain; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; +import java.util.stream.Stream; + +import jdk.internal.module.ServicesCatalog; +import jdk.internal.reflect.ConstantPool; +import sun.reflect.annotation.AnnotationType; +import sun.nio.ch.Interruptible; + +public interface JavaLangAccess { + + /** + * Returns the list of {@code Method} objects for the declared public + * methods of this class or interface that have the specified method name + * and parameter types. + */ + List getDeclaredPublicMethods(Class klass, String name, Class... parameterTypes); + + /** + * Return the constant pool for a class. + */ + ConstantPool getConstantPool(Class klass); + + /** + * Compare-And-Set 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, 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[] getEnumConstantsShared(Class klass); + + /** + * Set current thread's blocker field. + */ + void blockedOn(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 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; + + /** + * Returns the ConcurrentHashMap used as a storage for ClassLoaderValue(s) + * associated with the given class loader, creating it if it doesn't already exist. + */ + ConcurrentHashMap createOrGetClassLoaderValueMap(ClassLoader cl); + + /** + * Defines a class with the given name to a class loader. + */ + Class defineClass(ClassLoader cl, String name, byte[] b, ProtectionDomain pd, String source); + + /** + * Returns a class loaded by the bootstrap class loader. + */ + Class findBootstrapClassOrNull(ClassLoader cl, String name); + + /** + * Define a Package of the given name and module by the given class loader. + */ + Package definePackage(ClassLoader cl, String name, Module module); + + /** + * Invokes Long.fastUUID + */ + String fastUUID(long lsb, long msb); + + /** + * Record the non-exported packages of the modules in the given layer + */ + void addNonExportedPackages(ModuleLayer layer); + + /** + * Invalidate package access cache + */ + void invalidatePackageAccessCache(); + + /** + * Defines a new module to the Java virtual machine. The module + * is defined to the given class loader. + * + * The URI is for information purposes only, it can be {@code null}. + */ + Module defineModule(ClassLoader loader, ModuleDescriptor descriptor, URI uri); + + /** + * Defines the unnamed module for the given class loader. + */ + Module defineUnnamedModule(ClassLoader loader); + + /** + * Updates the readability so that module m1 reads m2. The new read edge + * does not result in a strong reference to m2 (m2 can be GC'ed). + * + * This method is the same as m1.addReads(m2) but without a permission check. + */ + void addReads(Module m1, Module m2); + + /** + * Updates module m to read all unnamed modules. + */ + void addReadsAllUnnamed(Module m); + + /** + * Updates module m1 to export a package to module m2. The export does + * not result in a strong reference to m2 (m2 can be GC'ed). + */ + void addExports(Module m1, String pkg, Module m2); + + /** + * Updates a module m to export a package to all unnamed modules. + */ + void addExportsToAllUnnamed(Module m, String pkg); + + /** + * Updates module m1 to open a package to module m2. Opening the + * package does not result in a strong reference to m2 (m2 can be GC'ed). + */ + void addOpens(Module m1, String pkg, Module m2); + + /** + * Updates module m to open a package to all unnamed modules. + */ + void addOpensToAllUnnamed(Module m, String pkg); + + /** + * Updates module m to open all packages returned by the given iterator. + */ + void addOpensToAllUnnamed(Module m, Iterator packages); + + /** + * Updates module m to use a service. + */ + void addUses(Module m, Class service); + + /** + * Returns true if module m reflectively exports a package to other + */ + boolean isReflectivelyExported(Module module, String pn, Module other); + + /** + * Returns true if module m reflectively opens a package to other + */ + boolean isReflectivelyOpened(Module module, String pn, Module other); + + /** + * Returns the ServicesCatalog for the given Layer. + */ + ServicesCatalog getServicesCatalog(ModuleLayer layer); + + /** + * Returns an ordered stream of layers. The first element is the + * given layer, the remaining elements are its parents, in DFS order. + */ + Stream layers(ModuleLayer layer); + + /** + * Returns a stream of the layers that have modules defined to the + * given class loader. + */ + Stream layers(ClassLoader loader); + + /** + * Constructs a new {@code String} by decoding the specified subarray of + * bytes using the specified {@linkplain java.nio.charset.Charset charset}. + * + * The caller of this method shall relinquish and transfer the ownership of + * the byte array to the callee since the later will not make a copy. + * + * @param bytes the byte array source + * @param cs the Charset + * @return the newly created string + * @throws CharacterCodingException for malformed or unmappable bytes + */ + String newStringNoRepl(byte[] bytes, Charset cs) throws CharacterCodingException; + + /** + * Encode the given string into a sequence of bytes using the specified Charset. + * + * This method avoids copying the String's internal representation if the input + * is ASCII. + * + * This method throws CharacterCodingException instead of replacing when + * malformed input or unmappable characters are encountered. + * + * @param s the string to encode + * @param cs the charset + * @return the encoded bytes + * @throws CharacterCodingException for malformed input or unmappable characters + */ + byte[] getBytesNoRepl(String s, Charset cs) throws CharacterCodingException; + + /** + * Returns a new string by decoding from the given utf8 bytes array. + * + * @param off the index of the first byte to decode + * @param len the number of bytes to decode + * @return the newly created string + * @throws IllegalArgumentException for malformed or unmappable bytes. + */ + String newStringUTF8NoRepl(byte[] bytes, int off, int len); + + /** + * Encode the given string into a sequence of bytes using utf8. + * + * @param s the string to encode + * @return the encoded bytes in utf8 + * @throws IllegalArgumentException for malformed surrogates + */ + byte[] getBytesUTF8NoRepl(String s); + + /** + * Set the cause of Throwable + * @param cause set t's cause to new value + */ + void setCause(Throwable t, Throwable cause); +} --- old/src/java.base/share/classes/jdk/internal/misc/JavaLangInvokeAccess.java 2018-11-01 19:11:40.000000000 -0700 +++ /dev/null 2018-11-01 19:11:40.000000000 -0700 @@ -1,109 +0,0 @@ -/* - * Copyright (c) 2015, 2017, 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.invoke.MethodType; -import java.util.Map; - -public interface JavaLangInvokeAccess { - /** - * Create a new MemberName instance. Used by {@code StackFrameInfo}. - */ - Object newMemberName(); - - /** - * Returns the name for the given MemberName. Used by {@code StackFrameInfo}. - */ - String getName(Object mname); - - /** - * Returns the {@code MethodType} for the given MemberName. - * Used by {@code StackFrameInfo}. - */ - MethodType getMethodType(Object mname); - - /** - * Returns the descriptor for the given MemberName. - * Used by {@code StackFrameInfo}. - */ - String getMethodDescriptor(Object mname); - - /** - * Returns {@code true} if the given MemberName is a native method. - * Used by {@code StackFrameInfo}. - */ - boolean isNative(Object mname); - - /** - * Returns the declaring class for the given MemberName. - * Used by {@code StackFrameInfo}. - */ - Class getDeclaringClass(Object mname); - - /** - * Returns a {@code byte[]} representation of a class implementing - * DirectMethodHandle of each pairwise combination of {@code MethodType} and - * an {@code int} representing method type. Used by - * GenerateJLIClassesPlugin to generate such a class during the jlink phase. - */ - byte[] generateDirectMethodHandleHolderClassBytes(String className, - MethodType[] methodTypes, int[] types); - - /** - * Returns a {@code byte[]} representation of a class implementing - * DelegatingMethodHandles of each {@code MethodType} kind in the - * {@code methodTypes} argument. Used by GenerateJLIClassesPlugin to - * generate such a class during the jlink phase. - */ - byte[] generateDelegatingMethodHandleHolderClassBytes(String className, - MethodType[] methodTypes); - - /** - * Returns a {@code byte[]} representation of {@code BoundMethodHandle} - * species class implementing the signature defined by {@code types}. Used - * by GenerateJLIClassesPlugin to enable generation of such classes during - * the jlink phase. Should do some added validation since this string may be - * user provided. - */ - Map.Entry generateConcreteBMHClassBytes( - final String types); - - /** - * Returns a {@code byte[]} representation of a class implementing - * the zero and identity forms of all {@code LambdaForm.BasicType}s. - */ - byte[] generateBasicFormsClassBytes(final String className); - - /** - * Returns a {@code byte[]} representation of a class implementing - * the invoker forms for the set of supplied {@code invokerMethodTypes} - * and {@code callSiteMethodTypes}. - */ - byte[] generateInvokersHolderClassBytes(String className, - MethodType[] invokerMethodTypes, - MethodType[] callSiteMethodTypes); - -} --- /dev/null 2018-11-01 19:11:40.000000000 -0700 +++ new/src/java.base/share/classes/jdk/internal/access/JavaLangInvokeAccess.java 2018-11-01 19:11:40.000000000 -0700 @@ -0,0 +1,109 @@ +/* + * Copyright (c) 2015, 2017, 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.access; + +import java.lang.invoke.MethodType; +import java.util.Map; + +public interface JavaLangInvokeAccess { + /** + * Create a new MemberName instance. Used by {@code StackFrameInfo}. + */ + Object newMemberName(); + + /** + * Returns the name for the given MemberName. Used by {@code StackFrameInfo}. + */ + String getName(Object mname); + + /** + * Returns the {@code MethodType} for the given MemberName. + * Used by {@code StackFrameInfo}. + */ + MethodType getMethodType(Object mname); + + /** + * Returns the descriptor for the given MemberName. + * Used by {@code StackFrameInfo}. + */ + String getMethodDescriptor(Object mname); + + /** + * Returns {@code true} if the given MemberName is a native method. + * Used by {@code StackFrameInfo}. + */ + boolean isNative(Object mname); + + /** + * Returns the declaring class for the given MemberName. + * Used by {@code StackFrameInfo}. + */ + Class getDeclaringClass(Object mname); + + /** + * Returns a {@code byte[]} representation of a class implementing + * DirectMethodHandle of each pairwise combination of {@code MethodType} and + * an {@code int} representing method type. Used by + * GenerateJLIClassesPlugin to generate such a class during the jlink phase. + */ + byte[] generateDirectMethodHandleHolderClassBytes(String className, + MethodType[] methodTypes, int[] types); + + /** + * Returns a {@code byte[]} representation of a class implementing + * DelegatingMethodHandles of each {@code MethodType} kind in the + * {@code methodTypes} argument. Used by GenerateJLIClassesPlugin to + * generate such a class during the jlink phase. + */ + byte[] generateDelegatingMethodHandleHolderClassBytes(String className, + MethodType[] methodTypes); + + /** + * Returns a {@code byte[]} representation of {@code BoundMethodHandle} + * species class implementing the signature defined by {@code types}. Used + * by GenerateJLIClassesPlugin to enable generation of such classes during + * the jlink phase. Should do some added validation since this string may be + * user provided. + */ + Map.Entry generateConcreteBMHClassBytes( + final String types); + + /** + * Returns a {@code byte[]} representation of a class implementing + * the zero and identity forms of all {@code LambdaForm.BasicType}s. + */ + byte[] generateBasicFormsClassBytes(final String className); + + /** + * Returns a {@code byte[]} representation of a class implementing + * the invoker forms for the set of supplied {@code invokerMethodTypes} + * and {@code callSiteMethodTypes}. + */ + byte[] generateInvokersHolderClassBytes(String className, + MethodType[] invokerMethodTypes, + MethodType[] callSiteMethodTypes); + +} --- old/src/java.base/share/classes/jdk/internal/misc/JavaLangModuleAccess.java 2018-11-01 19:11:42.000000000 -0700 +++ /dev/null 2018-11-01 19:11:42.000000000 -0700 @@ -1,140 +0,0 @@ -/* - * Copyright (c) 2015, 2017, 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.PrintStream; -import java.lang.module.Configuration; -import java.lang.module.ModuleDescriptor; -import java.lang.module.ModuleDescriptor.Exports; -import java.lang.module.ModuleDescriptor.Opens; -import java.lang.module.ModuleDescriptor.Requires; -import java.lang.module.ModuleDescriptor.Provides; -import java.lang.module.ModuleDescriptor.Version; -import java.lang.module.ModuleFinder; -import java.util.Collection; -import java.util.List; -import java.util.Map; -import java.util.Set; - -/** - * Provides access to non-public methods in java.lang.module. - */ - -public interface JavaLangModuleAccess { - - /** - * Creates a builder for building a module with the given module name. - * - * @param strict - * Indicates whether module names are checked or not - */ - ModuleDescriptor.Builder newModuleBuilder(String mn, - boolean strict, - Set ms); - - /** - * Returns a snapshot of the packages in the module. - */ - Set packages(ModuleDescriptor.Builder builder); - - /** - * Adds a dependence on a module with the given (possibly un-parsable) - * version string. - */ - void requires(ModuleDescriptor.Builder builder, - Set ms, - String mn, - String rawCompiledVersion); - - /** - * Returns a {@code ModuleDescriptor.Requires} of the given modifiers - * and module name. - */ - Requires newRequires(Set ms, String mn, Version v); - - /** - * Returns an unqualified {@code ModuleDescriptor.Exports} - * of the given modifiers and package name source. - */ - Exports newExports(Set ms, - String source); - - /** - * Returns a qualified {@code ModuleDescriptor.Exports} - * of the given modifiers, package name source and targets. - */ - Exports newExports(Set ms, - String source, - Set targets); - - /** - * Returns an unqualified {@code ModuleDescriptor.Opens} - * of the given modifiers and package name source. - */ - Opens newOpens(Set ms, String source); - - /** - * Returns a qualified {@code ModuleDescriptor.Opens} - * of the given modifiers, package name source and targets. - */ - Opens newOpens(Set ms, String source, Set targets); - - /** - * Returns a {@code ModuleDescriptor.Provides} - * of the given service name and providers. - */ - Provides newProvides(String service, List providers); - - /** - * Returns a new {@code ModuleDescriptor} instance. - */ - ModuleDescriptor newModuleDescriptor(String name, - Version version, - Set ms, - Set requires, - Set exports, - Set opens, - Set uses, - Set provides, - Set packages, - String mainClass, - int hashCode); - - /** - * Resolves a collection of root modules, with service binding - * and the empty configuration as the parent. - */ - Configuration resolveAndBind(ModuleFinder finder, - Collection roots, - PrintStream traceOutput); - - /** - * Creates a configuration from a pre-generated readability graph. - */ - Configuration newConfiguration(ModuleFinder finder, - Map> graph); - -} --- /dev/null 2018-11-01 19:11:42.000000000 -0700 +++ new/src/java.base/share/classes/jdk/internal/access/JavaLangModuleAccess.java 2018-11-01 19:11:41.000000000 -0700 @@ -0,0 +1,140 @@ +/* + * Copyright (c) 2015, 2017, 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.access; + +import java.io.PrintStream; +import java.lang.module.Configuration; +import java.lang.module.ModuleDescriptor; +import java.lang.module.ModuleDescriptor.Exports; +import java.lang.module.ModuleDescriptor.Opens; +import java.lang.module.ModuleDescriptor.Requires; +import java.lang.module.ModuleDescriptor.Provides; +import java.lang.module.ModuleDescriptor.Version; +import java.lang.module.ModuleFinder; +import java.util.Collection; +import java.util.List; +import java.util.Map; +import java.util.Set; + +/** + * Provides access to non-public methods in java.lang.module. + */ + +public interface JavaLangModuleAccess { + + /** + * Creates a builder for building a module with the given module name. + * + * @param strict + * Indicates whether module names are checked or not + */ + ModuleDescriptor.Builder newModuleBuilder(String mn, + boolean strict, + Set ms); + + /** + * Returns a snapshot of the packages in the module. + */ + Set packages(ModuleDescriptor.Builder builder); + + /** + * Adds a dependence on a module with the given (possibly un-parsable) + * version string. + */ + void requires(ModuleDescriptor.Builder builder, + Set ms, + String mn, + String rawCompiledVersion); + + /** + * Returns a {@code ModuleDescriptor.Requires} of the given modifiers + * and module name. + */ + Requires newRequires(Set ms, String mn, Version v); + + /** + * Returns an unqualified {@code ModuleDescriptor.Exports} + * of the given modifiers and package name source. + */ + Exports newExports(Set ms, + String source); + + /** + * Returns a qualified {@code ModuleDescriptor.Exports} + * of the given modifiers, package name source and targets. + */ + Exports newExports(Set ms, + String source, + Set targets); + + /** + * Returns an unqualified {@code ModuleDescriptor.Opens} + * of the given modifiers and package name source. + */ + Opens newOpens(Set ms, String source); + + /** + * Returns a qualified {@code ModuleDescriptor.Opens} + * of the given modifiers, package name source and targets. + */ + Opens newOpens(Set ms, String source, Set targets); + + /** + * Returns a {@code ModuleDescriptor.Provides} + * of the given service name and providers. + */ + Provides newProvides(String service, List providers); + + /** + * Returns a new {@code ModuleDescriptor} instance. + */ + ModuleDescriptor newModuleDescriptor(String name, + Version version, + Set ms, + Set requires, + Set exports, + Set opens, + Set uses, + Set provides, + Set packages, + String mainClass, + int hashCode); + + /** + * Resolves a collection of root modules, with service binding + * and the empty configuration as the parent. + */ + Configuration resolveAndBind(ModuleFinder finder, + Collection roots, + PrintStream traceOutput); + + /** + * Creates a configuration from a pre-generated readability graph. + */ + Configuration newConfiguration(ModuleFinder finder, + Map> graph); + +} --- old/src/java.base/share/classes/jdk/internal/misc/JavaLangRefAccess.java 2018-11-01 19:11:43.000000000 -0700 +++ /dev/null 2018-11-01 19:11:43.000000000 -0700 @@ -1,46 +0,0 @@ -/* - * Copyright (c) 2014, 2018, 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 { - - /** - * Wait for progress in {@link java.lang.ref.Reference} - * processing. If there aren't any pending {@link - * java.lang.ref.Reference}s, return immediately. - * - * @return {@code true} if there were any pending - * {@link java.lang.ref.Reference}s, {@code false} otherwise. - */ - boolean waitForReferenceProcessing() throws InterruptedException; - - /** - * Runs the finalization methods of any objects pending finalization. - * - * Invoked by Runtime.runFinalization() - */ - void runFinalization(); -} --- /dev/null 2018-11-01 19:11:43.000000000 -0700 +++ new/src/java.base/share/classes/jdk/internal/access/JavaLangRefAccess.java 2018-11-01 19:11:43.000000000 -0700 @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2014, 2018, 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.access; + +public interface JavaLangRefAccess { + + /** + * Wait for progress in {@link java.lang.ref.Reference} + * processing. If there aren't any pending {@link + * java.lang.ref.Reference}s, return immediately. + * + * @return {@code true} if there were any pending + * {@link java.lang.ref.Reference}s, {@code false} otherwise. + */ + boolean waitForReferenceProcessing() throws InterruptedException; + + /** + * Runs the finalization methods of any objects pending finalization. + * + * Invoked by Runtime.runFinalization() + */ + void runFinalization(); +} --- old/src/java.base/share/classes/jdk/internal/misc/JavaNetHttpCookieAccess.java 2018-11-01 19:11:44.000000000 -0700 +++ /dev/null 2018-11-01 19:11:45.000000000 -0700 @@ -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 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 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 2018-11-01 19:11:45.000000000 -0700 +++ new/src/java.base/share/classes/jdk/internal/access/JavaNetHttpCookieAccess.java 2018-11-01 19:11:44.000000000 -0700 @@ -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.access; + +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 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); +} + --- old/src/java.base/share/classes/jdk/internal/misc/JavaNetInetAddressAccess.java 2018-11-01 19:11:46.000000000 -0700 +++ /dev/null 2018-11-01 19:11:46.000000000 -0700 @@ -1,46 +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 jdk.internal.misc; - -import java.net.InetAddress; -import java.net.UnknownHostException; - -public interface JavaNetInetAddressAccess { - /** - * Return the original application specified hostname of - * the given InetAddress object. - */ - String getOriginalHostName(InetAddress ia); - - /** - * Get the InetAddress of the provided host. If an InetAddress is provided - * then it will be the default address returned for all calls to either - * form of getByName. This is required to maintain consistency when - * caching addresses and hostnames. - */ - InetAddress getByName(String hostName, InetAddress hostAddress) - throws UnknownHostException; -} --- /dev/null 2018-11-01 19:11:46.000000000 -0700 +++ new/src/java.base/share/classes/jdk/internal/access/JavaNetInetAddressAccess.java 2018-11-01 19:11:45.000000000 -0700 @@ -0,0 +1,46 @@ +/* + * 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.access; + +import java.net.InetAddress; +import java.net.UnknownHostException; + +public interface JavaNetInetAddressAccess { + /** + * Return the original application specified hostname of + * the given InetAddress object. + */ + String getOriginalHostName(InetAddress ia); + + /** + * Get the InetAddress of the provided host. If an InetAddress is provided + * then it will be the default address returned for all calls to either + * form of getByName. This is required to maintain consistency when + * caching addresses and hostnames. + */ + InetAddress getByName(String hostName, InetAddress hostAddress) + throws UnknownHostException; +} --- old/src/java.base/share/classes/jdk/internal/misc/JavaNetSocketAccess.java 2018-11-01 19:11:47.000000000 -0700 +++ /dev/null 2018-11-01 19:11:47.000000000 -0700 @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2016, 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.ServerSocket; -import java.net.SocketImpl; - -public interface JavaNetSocketAccess { - /** - * Creates a ServerSocket associated with the given SocketImpl. - */ - ServerSocket newServerSocket(SocketImpl impl); - - /* - * Constructs a SocketImpl instance of the given class. - */ - SocketImpl newSocketImpl(Class implClass); -} --- /dev/null 2018-11-01 19:11:47.000000000 -0700 +++ new/src/java.base/share/classes/jdk/internal/access/JavaNetSocketAccess.java 2018-11-01 19:11:47.000000000 -0700 @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2016, 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.access; + +import java.net.ServerSocket; +import java.net.SocketImpl; + +public interface JavaNetSocketAccess { + /** + * Creates a ServerSocket associated with the given SocketImpl. + */ + ServerSocket newServerSocket(SocketImpl impl); + + /* + * Constructs a SocketImpl instance of the given class. + */ + SocketImpl newSocketImpl(Class implClass); +} --- old/src/java.base/share/classes/jdk/internal/misc/JavaNetURLAccess.java 2018-11-01 19:11:49.000000000 -0700 +++ /dev/null 2018-11-01 19:11:49.000000000 -0700 @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2017, 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.URL; -import java.net.URLStreamHandler; - -public interface JavaNetURLAccess { - URLStreamHandler getHandler(URL u); -} --- /dev/null 2018-11-01 19:11:49.000000000 -0700 +++ new/src/java.base/share/classes/jdk/internal/access/JavaNetURLAccess.java 2018-11-01 19:11:48.000000000 -0700 @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2017, 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.access; + +import java.net.URL; +import java.net.URLStreamHandler; + +public interface JavaNetURLAccess { + URLStreamHandler getHandler(URL u); +} --- old/src/java.base/share/classes/jdk/internal/misc/JavaNetURLClassLoaderAccess.java 2018-11-01 19:11:50.000000000 -0700 +++ /dev/null 2018-11-01 19:11:50.000000000 -0700 @@ -1,33 +0,0 @@ -/* - * Copyright (c) 2016, 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 java.security.AccessControlContext; - -public interface JavaNetURLClassLoaderAccess { - AccessControlContext getAccessControlContext(URLClassLoader u);; -} --- /dev/null 2018-11-01 19:11:50.000000000 -0700 +++ new/src/java.base/share/classes/jdk/internal/access/JavaNetURLClassLoaderAccess.java 2018-11-01 19:11:49.000000000 -0700 @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2016, 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.access; + +import java.net.URLClassLoader; +import java.security.AccessControlContext; + +public interface JavaNetURLClassLoaderAccess { + AccessControlContext getAccessControlContext(URLClassLoader u);; +} --- old/src/java.base/share/classes/jdk/internal/misc/JavaNetUriAccess.java 2018-11-01 19:11:52.000000000 -0700 +++ /dev/null 2018-11-01 19:11:52.000000000 -0700 @@ -1,35 +0,0 @@ -/* - * Copyright (c) 2006, 2016, 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.URI; - -public interface JavaNetUriAccess { - /** - * Create a URI of pre-validated scheme and path. - */ - URI create(String scheme, String path); -} --- /dev/null 2018-11-01 19:11:52.000000000 -0700 +++ new/src/java.base/share/classes/jdk/internal/access/JavaNetUriAccess.java 2018-11-01 19:11:51.000000000 -0700 @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2006, 2016, 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.access; + +import java.net.URI; + +public interface JavaNetUriAccess { + /** + * Create a URI of pre-validated scheme and path. + */ + URI create(String scheme, String path); +} --- old/src/java.base/share/classes/jdk/internal/misc/JavaNioAccess.java 2018-11-01 19:11:53.000000000 -0700 +++ /dev/null 2018-11-01 19:11:53.000000000 -0700 @@ -1,42 +0,0 @@ -/* - * Copyright (c) 2007, 2018, 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(); -} --- /dev/null 2018-11-01 19:11:53.000000000 -0700 +++ new/src/java.base/share/classes/jdk/internal/access/JavaNioAccess.java 2018-11-01 19:11:52.000000000 -0700 @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2007, 2018, 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.access; + +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(); +} --- old/src/java.base/share/classes/jdk/internal/misc/JavaObjectInputFilterAccess.java 2018-11-01 19:11:55.000000000 -0700 +++ /dev/null 2018-11-01 19:11:55.000000000 -0700 @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2017, 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.ObjectInputFilter; - -/** - * Access to the alternative ObjectInputFilter.Config.createFilter2 for RMI. - */ -public interface JavaObjectInputFilterAccess { - /** - * Creates a filter from the pattern. - */ - ObjectInputFilter createFilter2(String pattern); -} --- /dev/null 2018-11-01 19:11:55.000000000 -0700 +++ new/src/java.base/share/classes/jdk/internal/access/JavaObjectInputFilterAccess.java 2018-11-01 19:11:54.000000000 -0700 @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2017, 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.access; + +import java.io.ObjectInputFilter; + +/** + * Access to the alternative ObjectInputFilter.Config.createFilter2 for RMI. + */ +public interface JavaObjectInputFilterAccess { + /** + * Creates a filter from the pattern. + */ + ObjectInputFilter createFilter2(String pattern); +} --- old/src/java.base/share/classes/jdk/internal/misc/JavaObjectInputStreamAccess.java 2018-11-01 19:11:56.000000000 -0700 +++ /dev/null 2018-11-01 19:11:56.000000000 -0700 @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2017, 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.InvalidClassException; -import java.io.ObjectInputStream; - -/** - * Interface to specify methods for accessing {@code ObjectInputStream}. - */ -@FunctionalInterface -public interface JavaObjectInputStreamAccess { - void checkArray(ObjectInputStream ois, Class arrayType, int arrayLength) - throws InvalidClassException; -} --- /dev/null 2018-11-01 19:11:56.000000000 -0700 +++ new/src/java.base/share/classes/jdk/internal/access/JavaObjectInputStreamAccess.java 2018-11-01 19:11:55.000000000 -0700 @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2017, 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.access; + +import java.io.InvalidClassException; +import java.io.ObjectInputStream; + +/** + * Interface to specify methods for accessing {@code ObjectInputStream}. + */ +@FunctionalInterface +public interface JavaObjectInputStreamAccess { + void checkArray(ObjectInputStream ois, Class arrayType, int arrayLength) + throws InvalidClassException; +} --- old/src/java.base/share/classes/jdk/internal/misc/JavaSecurityAccess.java 2018-11-01 19:11:57.000000000 -0700 +++ /dev/null 2018-11-01 19:11:58.000000000 -0700 @@ -1,53 +0,0 @@ -/* - * Copyright (c) 2010, 2018, 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.PermissionCollection; -import java.security.PrivilegedAction; -import java.security.ProtectionDomain; - -public interface JavaSecurityAccess { - - T doIntersectionPrivilege(PrivilegedAction action, - AccessControlContext stack, - AccessControlContext context); - - T doIntersectionPrivilege(PrivilegedAction action, - AccessControlContext context); - - ProtectionDomain[] getProtectDomains(AccessControlContext context); - - interface ProtectionDomainCache { - void put(ProtectionDomain pd, PermissionCollection pc); - PermissionCollection get(ProtectionDomain pd); - } - - /** - * Returns the ProtectionDomainCache. - */ - ProtectionDomainCache getProtectionDomainCache(); -} --- /dev/null 2018-11-01 19:11:58.000000000 -0700 +++ new/src/java.base/share/classes/jdk/internal/access/JavaSecurityAccess.java 2018-11-01 19:11:57.000000000 -0700 @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2010, 2018, 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.access; + +import java.security.AccessControlContext; +import java.security.PermissionCollection; +import java.security.PrivilegedAction; +import java.security.ProtectionDomain; + +public interface JavaSecurityAccess { + + T doIntersectionPrivilege(PrivilegedAction action, + AccessControlContext stack, + AccessControlContext context); + + T doIntersectionPrivilege(PrivilegedAction action, + AccessControlContext context); + + ProtectionDomain[] getProtectDomains(AccessControlContext context); + + interface ProtectionDomainCache { + void put(ProtectionDomain pd, PermissionCollection pc); + PermissionCollection get(ProtectionDomain pd); + } + + /** + * Returns the ProtectionDomainCache. + */ + ProtectionDomainCache getProtectionDomainCache(); +} --- old/src/java.base/share/classes/jdk/internal/misc/JavaUtilJarAccess.java 2018-11-01 19:11:59.000000000 -0700 +++ /dev/null 2018-11-01 19:11:59.000000000 -0700 @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2002, 2018, 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.Attributes; -import java.util.jar.JarEntry; -import java.util.jar.JarFile; -import java.util.jar.Manifest; - -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 entryNames(JarFile jar, CodeSource[] cs); - public Enumeration entries2(JarFile jar); - public void setEagerValidation(JarFile jar, boolean eager); - public List getManifestDigests(JarFile jar); - public Attributes getTrustedAttributes(Manifest man, String name); - public void ensureInitialization(JarFile jar); -} --- /dev/null 2018-11-01 19:11:59.000000000 -0700 +++ new/src/java.base/share/classes/jdk/internal/access/JavaUtilJarAccess.java 2018-11-01 19:11:58.000000000 -0700 @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2002, 2018, 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.access; + +import java.io.IOException; +import java.net.URL; +import java.security.CodeSource; +import java.util.Enumeration; +import java.util.List; +import java.util.jar.Attributes; +import java.util.jar.JarEntry; +import java.util.jar.JarFile; +import java.util.jar.Manifest; + +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 entryNames(JarFile jar, CodeSource[] cs); + public Enumeration entries2(JarFile jar); + public void setEagerValidation(JarFile jar, boolean eager); + public List getManifestDigests(JarFile jar); + public Attributes getTrustedAttributes(Manifest man, String name); + public void ensureInitialization(JarFile jar); +} --- old/src/java.base/share/classes/jdk/internal/misc/JavaUtilResourceBundleAccess.java 2018-11-01 19:12:00.000000000 -0700 +++ /dev/null 2018-11-01 19:12:00.000000000 -0700 @@ -1,66 +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 jdk.internal.misc; - -import java.util.Locale; -import java.util.ResourceBundle; - -/** - * Provides access to non-public methods in java.util.ResourceBundle. - */ -public interface JavaUtilResourceBundleAccess { - /** - * Sets the bundle's parent to the given parent. - */ - void setParent(ResourceBundle bundle, ResourceBundle parent); - - /** - * Returns the parent of the given bundle or null if the bundle has no parent. - */ - ResourceBundle getParent(ResourceBundle bundle); - - /** - * Sets the bundle's locale to the given locale. - */ - void setLocale(ResourceBundle bundle, Locale locale); - - /** - * Sets the bundle's base name to the given name. - */ - void setName(ResourceBundle bundle, String name); - - /** - * Returns a {@code ResourceBundle} of the given baseName and locale - * loaded on behalf of the given module with no caller module - * access check. - */ - ResourceBundle getBundle(String baseName, Locale locale, Module module); - - /** - * Instantiates a {@code ResourceBundle} of the given bundle class. - */ - ResourceBundle newResourceBundle(Class bundleClass); -} --- /dev/null 2018-11-01 19:12:00.000000000 -0700 +++ new/src/java.base/share/classes/jdk/internal/access/JavaUtilResourceBundleAccess.java 2018-11-01 19:12:00.000000000 -0700 @@ -0,0 +1,66 @@ +/* + * 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.access; + +import java.util.Locale; +import java.util.ResourceBundle; + +/** + * Provides access to non-public methods in java.util.ResourceBundle. + */ +public interface JavaUtilResourceBundleAccess { + /** + * Sets the bundle's parent to the given parent. + */ + void setParent(ResourceBundle bundle, ResourceBundle parent); + + /** + * Returns the parent of the given bundle or null if the bundle has no parent. + */ + ResourceBundle getParent(ResourceBundle bundle); + + /** + * Sets the bundle's locale to the given locale. + */ + void setLocale(ResourceBundle bundle, Locale locale); + + /** + * Sets the bundle's base name to the given name. + */ + void setName(ResourceBundle bundle, String name); + + /** + * Returns a {@code ResourceBundle} of the given baseName and locale + * loaded on behalf of the given module with no caller module + * access check. + */ + ResourceBundle getBundle(String baseName, Locale locale, Module module); + + /** + * Instantiates a {@code ResourceBundle} of the given bundle class. + */ + ResourceBundle newResourceBundle(Class bundleClass); +} --- old/src/java.base/share/classes/jdk/internal/misc/JavaUtilZipFileAccess.java 2018-11-01 19:12:02.000000000 -0700 +++ /dev/null 2018-11-01 19:12:02.000000000 -0700 @@ -1,43 +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 jdk.internal.misc; - -import java.io.IOException; -import java.util.Enumeration; -import java.util.function.Function; -import java.util.jar.JarEntry; -import java.util.stream.Stream; -import java.util.zip.ZipFile; - -public interface JavaUtilZipFileAccess { - public boolean startsWithLocHeader(ZipFile zip); - public String[] getMetaInfEntryNames(ZipFile zip); - public JarEntry getEntry(ZipFile zip, String name, Function func); - public Enumeration entries(ZipFile zip, Function func); - public Stream stream(ZipFile zip, Function func); - public Stream entryNameStream(ZipFile zip); -} - --- /dev/null 2018-11-01 19:12:02.000000000 -0700 +++ new/src/java.base/share/classes/jdk/internal/access/JavaUtilZipFileAccess.java 2018-11-01 19:12:01.000000000 -0700 @@ -0,0 +1,43 @@ +/* + * 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.access; + +import java.io.IOException; +import java.util.Enumeration; +import java.util.function.Function; +import java.util.jar.JarEntry; +import java.util.stream.Stream; +import java.util.zip.ZipFile; + +public interface JavaUtilZipFileAccess { + public boolean startsWithLocHeader(ZipFile zip); + public String[] getMetaInfEntryNames(ZipFile zip); + public JarEntry getEntry(ZipFile zip, String name, Function func); + public Enumeration entries(ZipFile zip, Function func); + public Stream stream(ZipFile zip, Function func); + public Stream entryNameStream(ZipFile zip); +} + --- old/src/java.base/share/classes/jdk/internal/misc/JavaxCryptoSealedObjectAccess.java 2018-11-01 19:12:03.000000000 -0700 +++ /dev/null 2018-11-01 19:12:03.000000000 -0700 @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2018, 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 javax.crypto.BadPaddingException; -import javax.crypto.Cipher; -import javax.crypto.IllegalBlockSizeException; -import javax.crypto.SealedObject; -import java.io.IOException; -import java.io.ObjectInputStream; - -public interface JavaxCryptoSealedObjectAccess { - ObjectInputStream getExtObjectInputStream( - SealedObject sealed, Cipher cipher) - throws BadPaddingException, IllegalBlockSizeException, IOException; -} --- /dev/null 2018-11-01 19:12:03.000000000 -0700 +++ new/src/java.base/share/classes/jdk/internal/access/JavaxCryptoSealedObjectAccess.java 2018-11-01 19:12:03.000000000 -0700 @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2018, 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.access; + +import javax.crypto.BadPaddingException; +import javax.crypto.Cipher; +import javax.crypto.IllegalBlockSizeException; +import javax.crypto.SealedObject; +import java.io.IOException; +import java.io.ObjectInputStream; + +public interface JavaxCryptoSealedObjectAccess { + ObjectInputStream getExtObjectInputStream( + SealedObject sealed, Cipher cipher) + throws BadPaddingException, IllegalBlockSizeException, IOException; +} --- old/src/java.base/share/classes/jdk/internal/misc/SharedSecrets.java 2018-11-01 19:12:05.000000000 -0700 +++ /dev/null 2018-11-01 19:12:05.000000000 -0700 @@ -1,339 +0,0 @@ -/* - * Copyright (c) 2002, 2018, 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 javax.crypto.SealedObject; -import java.io.ObjectInputFilter; -import java.lang.module.ModuleDescriptor; -import java.util.ResourceBundle; -import java.util.jar.JarFile; -import java.io.Console; -import java.io.FileDescriptor; -import java.io.FilePermission; -import java.io.ObjectInputStream; -import java.io.RandomAccessFile; -import java.security.ProtectionDomain; - -/** 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 JavaLangModuleAccess javaLangModuleAccess; - private static JavaLangInvokeAccess javaLangInvokeAccess; - private static JavaLangRefAccess javaLangRefAccess; - private static JavaIOAccess javaIOAccess; - private static JavaNetInetAddressAccess javaNetInetAddressAccess; - private static JavaNetHttpCookieAccess javaNetHttpCookieAccess; - private static JavaNetSocketAccess javaNetSocketAccess; - private static JavaNetUriAccess javaNetUriAccess; - private static JavaNetURLAccess javaNetURLAccess; - private static JavaNetURLClassLoaderAccess javaNetURLClassLoaderAccess; - private static JavaNioAccess javaNioAccess; - private static JavaIOFileDescriptorAccess javaIOFileDescriptorAccess; - private static JavaIOFilePermissionAccess javaIOFilePermissionAccess; - private static JavaSecurityAccess javaSecurityAccess; - private static JavaUtilZipFileAccess javaUtilZipFileAccess; - private static JavaUtilResourceBundleAccess javaUtilResourceBundleAccess; - private static JavaAWTAccess javaAWTAccess; - private static JavaAWTFontAccess javaAWTFontAccess; - private static JavaBeansAccess javaBeansAccess; - private static JavaObjectInputStreamAccess javaObjectInputStreamAccess; - private static JavaObjectInputFilterAccess javaObjectInputFilterAccess; - private static JavaIORandomAccessFileAccess javaIORandomAccessFileAccess; - private static JavaxCryptoSealedObjectAccess javaxCryptoSealedObjectAccess; - - 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 setJavaLangInvokeAccess(JavaLangInvokeAccess jlia) { - javaLangInvokeAccess = jlia; - } - - public static JavaLangInvokeAccess getJavaLangInvokeAccess() { - if (javaLangInvokeAccess == null) { - try { - Class c = Class.forName("java.lang.invoke.MethodHandleImpl"); - unsafe.ensureClassInitialized(c); - } catch (ClassNotFoundException e) {}; - } - return javaLangInvokeAccess; - } - - public static void setJavaLangModuleAccess(JavaLangModuleAccess jlrma) { - javaLangModuleAccess = jlrma; - } - - public static JavaLangModuleAccess getJavaLangModuleAccess() { - if (javaLangModuleAccess == null) { - unsafe.ensureClassInitialized(ModuleDescriptor.class); - } - return javaLangModuleAccess; - } - - public static void setJavaLangRefAccess(JavaLangRefAccess jlra) { - javaLangRefAccess = jlra; - } - - public static JavaLangRefAccess getJavaLangRefAccess() { - return javaLangRefAccess; - } - - public static void setJavaNetUriAccess(JavaNetUriAccess jnua) { - javaNetUriAccess = jnua; - } - - public static JavaNetUriAccess getJavaNetUriAccess() { - if (javaNetUriAccess == null) - unsafe.ensureClassInitialized(java.net.URI.class); - return javaNetUriAccess; - } - - public static void setJavaNetURLAccess(JavaNetURLAccess jnua) { - javaNetURLAccess = jnua; - } - - public static JavaNetURLAccess getJavaNetURLAccess() { - if (javaNetURLAccess == null) - unsafe.ensureClassInitialized(java.net.URL.class); - return javaNetURLAccess; - } - - public static void setJavaNetURLClassLoaderAccess(JavaNetURLClassLoaderAccess jnua) { - javaNetURLClassLoaderAccess = jnua; - } - - public static JavaNetURLClassLoaderAccess getJavaNetURLClassLoaderAccess() { - if (javaNetURLClassLoaderAccess == null) - unsafe.ensureClassInitialized(java.net.URLClassLoader.class); - return javaNetURLClassLoaderAccess; - } - - public static void setJavaNetInetAddressAccess(JavaNetInetAddressAccess jna) { - javaNetInetAddressAccess = jna; - } - - public static JavaNetInetAddressAccess getJavaNetInetAddressAccess() { - if (javaNetInetAddressAccess == null) - unsafe.ensureClassInitialized(java.net.InetAddress.class); - 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 setJavaNetSocketAccess(JavaNetSocketAccess jnsa) { - javaNetSocketAccess = jnsa; - } - - public static JavaNetSocketAccess getJavaNetSocketAccess() { - if (javaNetSocketAccess == null) - unsafe.ensureClassInitialized(java.net.ServerSocket.class); - return javaNetSocketAccess; - } - - public static void setJavaNioAccess(JavaNioAccess jna) { - javaNioAccess = jna; - } - - public static JavaNioAccess getJavaNioAccess() { - if (javaNioAccess == null) { - // Ensure java.nio.Buffer is initialized, which provides the - // shared secret. - unsafe.ensureClassInitialized(java.nio.Buffer.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 JavaIOFilePermissionAccess getJavaIOFilePermissionAccess() { - if (javaIOFilePermissionAccess == null) - unsafe.ensureClassInitialized(FilePermission.class); - - return javaIOFilePermissionAccess; - } - - public static void setJavaIOFilePermissionAccess(JavaIOFilePermissionAccess jiofpa) { - javaIOFilePermissionAccess = jiofpa; - } - - public static JavaIOFileDescriptorAccess getJavaIOFileDescriptorAccess() { - if (javaIOFileDescriptorAccess == null) - unsafe.ensureClassInitialized(FileDescriptor.class); - - return javaIOFileDescriptorAccess; - } - - public static void setJavaSecurityAccess(JavaSecurityAccess jsa) { - javaSecurityAccess = jsa; - } - - public static JavaSecurityAccess getJavaSecurityAccess() { - if (javaSecurityAccess == null) { - unsafe.ensureClassInitialized(ProtectionDomain.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; - } - - public static JavaUtilResourceBundleAccess getJavaUtilResourceBundleAccess() { - if (javaUtilResourceBundleAccess == null) - unsafe.ensureClassInitialized(ResourceBundle.class); - return javaUtilResourceBundleAccess; - } - - public static void setJavaUtilResourceBundleAccess(JavaUtilResourceBundleAccess access) { - javaUtilResourceBundleAccess = access; - } - - public static JavaObjectInputStreamAccess getJavaObjectInputStreamAccess() { - if (javaObjectInputStreamAccess == null) { - unsafe.ensureClassInitialized(ObjectInputStream.class); - } - return javaObjectInputStreamAccess; - } - - public static void setJavaObjectInputStreamAccess(JavaObjectInputStreamAccess access) { - javaObjectInputStreamAccess = access; - } - - public static JavaObjectInputFilterAccess getJavaObjectInputFilterAccess() { - if (javaObjectInputFilterAccess == null) { - unsafe.ensureClassInitialized(ObjectInputFilter.Config.class); - } - return javaObjectInputFilterAccess; - } - - public static void setJavaObjectInputFilterAccess(JavaObjectInputFilterAccess access) { - javaObjectInputFilterAccess = access; - } - - public static void setJavaIORandomAccessFileAccess(JavaIORandomAccessFileAccess jirafa) { - javaIORandomAccessFileAccess = jirafa; - } - - public static JavaIORandomAccessFileAccess getJavaIORandomAccessFileAccess() { - if (javaIORandomAccessFileAccess == null) { - unsafe.ensureClassInitialized(RandomAccessFile.class); - } - return javaIORandomAccessFileAccess; - } - - public static void setJavaxCryptoSealedObjectAccess(JavaxCryptoSealedObjectAccess jcsoa) { - javaxCryptoSealedObjectAccess = jcsoa; - } - - public static JavaxCryptoSealedObjectAccess getJavaxCryptoSealedObjectAccess() { - if (javaxCryptoSealedObjectAccess == null) { - unsafe.ensureClassInitialized(SealedObject.class); - } - return javaxCryptoSealedObjectAccess; - } -} --- /dev/null 2018-11-01 19:12:05.000000000 -0700 +++ new/src/java.base/share/classes/jdk/internal/access/SharedSecrets.java 2018-11-01 19:12:04.000000000 -0700 @@ -0,0 +1,340 @@ +/* + * Copyright (c) 2002, 2018, 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.access; + +import javax.crypto.SealedObject; +import java.io.ObjectInputFilter; +import java.lang.module.ModuleDescriptor; +import java.util.ResourceBundle; +import java.util.jar.JarFile; +import java.io.Console; +import java.io.FileDescriptor; +import java.io.FilePermission; +import java.io.ObjectInputStream; +import java.io.RandomAccessFile; +import java.security.ProtectionDomain; + +/** 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 jdk.internal.misc.Unsafe unsafe = + jdk.internal.misc.Unsafe.getUnsafe(); + private static JavaUtilJarAccess javaUtilJarAccess; + private static JavaLangAccess javaLangAccess; + private static JavaLangModuleAccess javaLangModuleAccess; + private static JavaLangInvokeAccess javaLangInvokeAccess; + private static JavaLangRefAccess javaLangRefAccess; + private static JavaIOAccess javaIOAccess; + private static JavaNetInetAddressAccess javaNetInetAddressAccess; + private static JavaNetHttpCookieAccess javaNetHttpCookieAccess; + private static JavaNetSocketAccess javaNetSocketAccess; + private static JavaNetUriAccess javaNetUriAccess; + private static JavaNetURLAccess javaNetURLAccess; + private static JavaNetURLClassLoaderAccess javaNetURLClassLoaderAccess; + private static JavaNioAccess javaNioAccess; + private static JavaIOFileDescriptorAccess javaIOFileDescriptorAccess; + private static JavaIOFilePermissionAccess javaIOFilePermissionAccess; + private static JavaSecurityAccess javaSecurityAccess; + private static JavaUtilZipFileAccess javaUtilZipFileAccess; + private static JavaUtilResourceBundleAccess javaUtilResourceBundleAccess; + private static JavaAWTAccess javaAWTAccess; + private static JavaAWTFontAccess javaAWTFontAccess; + private static JavaBeansAccess javaBeansAccess; + private static JavaObjectInputStreamAccess javaObjectInputStreamAccess; + private static JavaObjectInputFilterAccess javaObjectInputFilterAccess; + private static JavaIORandomAccessFileAccess javaIORandomAccessFileAccess; + private static JavaxCryptoSealedObjectAccess javaxCryptoSealedObjectAccess; + + 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 setJavaLangInvokeAccess(JavaLangInvokeAccess jlia) { + javaLangInvokeAccess = jlia; + } + + public static JavaLangInvokeAccess getJavaLangInvokeAccess() { + if (javaLangInvokeAccess == null) { + try { + Class c = Class.forName("java.lang.invoke.MethodHandleImpl"); + unsafe.ensureClassInitialized(c); + } catch (ClassNotFoundException e) {}; + } + return javaLangInvokeAccess; + } + + public static void setJavaLangModuleAccess(JavaLangModuleAccess jlrma) { + javaLangModuleAccess = jlrma; + } + + public static JavaLangModuleAccess getJavaLangModuleAccess() { + if (javaLangModuleAccess == null) { + unsafe.ensureClassInitialized(ModuleDescriptor.class); + } + return javaLangModuleAccess; + } + + public static void setJavaLangRefAccess(JavaLangRefAccess jlra) { + javaLangRefAccess = jlra; + } + + public static JavaLangRefAccess getJavaLangRefAccess() { + return javaLangRefAccess; + } + + public static void setJavaNetUriAccess(JavaNetUriAccess jnua) { + javaNetUriAccess = jnua; + } + + public static JavaNetUriAccess getJavaNetUriAccess() { + if (javaNetUriAccess == null) + unsafe.ensureClassInitialized(java.net.URI.class); + return javaNetUriAccess; + } + + public static void setJavaNetURLAccess(JavaNetURLAccess jnua) { + javaNetURLAccess = jnua; + } + + public static JavaNetURLAccess getJavaNetURLAccess() { + if (javaNetURLAccess == null) + unsafe.ensureClassInitialized(java.net.URL.class); + return javaNetURLAccess; + } + + public static void setJavaNetURLClassLoaderAccess(JavaNetURLClassLoaderAccess jnua) { + javaNetURLClassLoaderAccess = jnua; + } + + public static JavaNetURLClassLoaderAccess getJavaNetURLClassLoaderAccess() { + if (javaNetURLClassLoaderAccess == null) + unsafe.ensureClassInitialized(java.net.URLClassLoader.class); + return javaNetURLClassLoaderAccess; + } + + public static void setJavaNetInetAddressAccess(JavaNetInetAddressAccess jna) { + javaNetInetAddressAccess = jna; + } + + public static JavaNetInetAddressAccess getJavaNetInetAddressAccess() { + if (javaNetInetAddressAccess == null) + unsafe.ensureClassInitialized(java.net.InetAddress.class); + 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 setJavaNetSocketAccess(JavaNetSocketAccess jnsa) { + javaNetSocketAccess = jnsa; + } + + public static JavaNetSocketAccess getJavaNetSocketAccess() { + if (javaNetSocketAccess == null) + unsafe.ensureClassInitialized(java.net.ServerSocket.class); + return javaNetSocketAccess; + } + + public static void setJavaNioAccess(JavaNioAccess jna) { + javaNioAccess = jna; + } + + public static JavaNioAccess getJavaNioAccess() { + if (javaNioAccess == null) { + // Ensure java.nio.Buffer is initialized, which provides the + // shared secret. + unsafe.ensureClassInitialized(java.nio.Buffer.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 JavaIOFilePermissionAccess getJavaIOFilePermissionAccess() { + if (javaIOFilePermissionAccess == null) + unsafe.ensureClassInitialized(FilePermission.class); + + return javaIOFilePermissionAccess; + } + + public static void setJavaIOFilePermissionAccess(JavaIOFilePermissionAccess jiofpa) { + javaIOFilePermissionAccess = jiofpa; + } + + public static JavaIOFileDescriptorAccess getJavaIOFileDescriptorAccess() { + if (javaIOFileDescriptorAccess == null) + unsafe.ensureClassInitialized(FileDescriptor.class); + + return javaIOFileDescriptorAccess; + } + + public static void setJavaSecurityAccess(JavaSecurityAccess jsa) { + javaSecurityAccess = jsa; + } + + public static JavaSecurityAccess getJavaSecurityAccess() { + if (javaSecurityAccess == null) { + unsafe.ensureClassInitialized(ProtectionDomain.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; + } + + public static JavaUtilResourceBundleAccess getJavaUtilResourceBundleAccess() { + if (javaUtilResourceBundleAccess == null) + unsafe.ensureClassInitialized(ResourceBundle.class); + return javaUtilResourceBundleAccess; + } + + public static void setJavaUtilResourceBundleAccess(JavaUtilResourceBundleAccess access) { + javaUtilResourceBundleAccess = access; + } + + public static JavaObjectInputStreamAccess getJavaObjectInputStreamAccess() { + if (javaObjectInputStreamAccess == null) { + unsafe.ensureClassInitialized(ObjectInputStream.class); + } + return javaObjectInputStreamAccess; + } + + public static void setJavaObjectInputStreamAccess(JavaObjectInputStreamAccess access) { + javaObjectInputStreamAccess = access; + } + + public static JavaObjectInputFilterAccess getJavaObjectInputFilterAccess() { + if (javaObjectInputFilterAccess == null) { + unsafe.ensureClassInitialized(ObjectInputFilter.Config.class); + } + return javaObjectInputFilterAccess; + } + + public static void setJavaObjectInputFilterAccess(JavaObjectInputFilterAccess access) { + javaObjectInputFilterAccess = access; + } + + public static void setJavaIORandomAccessFileAccess(JavaIORandomAccessFileAccess jirafa) { + javaIORandomAccessFileAccess = jirafa; + } + + public static JavaIORandomAccessFileAccess getJavaIORandomAccessFileAccess() { + if (javaIORandomAccessFileAccess == null) { + unsafe.ensureClassInitialized(RandomAccessFile.class); + } + return javaIORandomAccessFileAccess; + } + + public static void setJavaxCryptoSealedObjectAccess(JavaxCryptoSealedObjectAccess jcsoa) { + javaxCryptoSealedObjectAccess = jcsoa; + } + + public static JavaxCryptoSealedObjectAccess getJavaxCryptoSealedObjectAccess() { + if (javaxCryptoSealedObjectAccess == null) { + unsafe.ensureClassInitialized(SealedObject.class); + } + return javaxCryptoSealedObjectAccess; + } +} --- /dev/null 2018-11-01 19:12:06.000000000 -0700 +++ new/src/java.base/share/classes/jdk/internal/misc/FileSystemOption.java 2018-11-01 19:12:05.000000000 -0700 @@ -0,0 +1,90 @@ +/* + * Copyright (c) 2018, 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 sun.nio.fs.ExtendedOptions; + +import java.nio.file.CopyOption; +import java.nio.file.OpenOption; +import java.nio.file.WatchEvent; + +/** + * Internal file system options for jdk.unsupported com.sun.nio.file API use. + */ +public final class FileSystemOption { + public static final FileSystemOption INTERRUPTIBLE = + new FileSystemOption<>(ExtendedOptions.INTERRUPTIBLE); + public static final FileSystemOption NOSHARE_READ = + new FileSystemOption<>(ExtendedOptions.NOSHARE_READ); + public static final FileSystemOption NOSHARE_WRITE = + new FileSystemOption<>(ExtendedOptions.NOSHARE_WRITE); + public static final FileSystemOption NOSHARE_DELETE = + new FileSystemOption<>(ExtendedOptions.NOSHARE_DELETE); + public static final FileSystemOption FILE_TREE = + new FileSystemOption<>(ExtendedOptions.FILE_TREE); + public static final FileSystemOption DIRECT = + new FileSystemOption<>(ExtendedOptions.DIRECT); + public static final FileSystemOption SENSITIVITY_HIGH = + new FileSystemOption<>(ExtendedOptions.SENSITIVITY_HIGH); + public static final FileSystemOption SENSITIVITY_MEDIUM = + new FileSystemOption<>(ExtendedOptions.SENSITIVITY_MEDIUM); + public static final FileSystemOption SENSITIVITY_LOW = + new FileSystemOption<>(ExtendedOptions.SENSITIVITY_LOW); + + private final ExtendedOptions.InternalOption internalOption; + private FileSystemOption(ExtendedOptions.InternalOption option) { + this.internalOption = option; + } + + /** + * Register this internal option as a OpenOption. + */ + public void register(OpenOption option) { + internalOption.register(option); + } + + /** + * Register this internal option as a CopyOption. + */ + public void register(CopyOption option) { + internalOption.register(option); + } + + /** + * Register this internal option as a WatchEvent.Modifier. + */ + public void register(WatchEvent.Modifier option) { + internalOption.register(option); + } + + /** + * Register this internal option as a WatchEvent.Modifier with the + * given parameter. + */ + public void register(WatchEvent.Modifier option, T param) { + internalOption.register(option, param); + } +}