changeset 17240:e8f3a872e69a

8181442: Deprecate sun.misc.Unsafe.defineClass Reviewed-by: shade, mchung
author psandoz
date Mon, 12 Jun 2017 14:30:40 -0700
parents 42f18c931bd4
children 573efb47b310
files src/jdk.unsupported/share/classes/sun/misc/Unsafe.java
diffstat 1 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/jdk.unsupported/share/classes/sun/misc/Unsafe.java	Fri Jun 09 11:26:42 2017 -0700
+++ b/src/jdk.unsupported/share/classes/sun/misc/Unsafe.java	Mon Jun 12 14:30:40 2017 -0700
@@ -813,8 +813,15 @@
     /**
      * Tells the VM to define a class, without security checks.  By default, the
      * class loader and protection domain come from the caller's class.
+     *
+     * @deprecated Use {@link java.lang.invoke.MethodHandles.Lookup#defineClass MethodHandles.Lookup#defineClass}
+     * to define a class to the same class loader and in the same runtime package
+     * and {@linkplain java.security.ProtectionDomain protection domain} of a
+     * given {@code Lookup}'s {@linkplain java.lang.invoke.MethodHandles.Lookup#lookupClass() lookup class}.
+     *
      * @see java.lang.invoke.MethodHandles.Lookup#defineClass(byte[])
      */
+    @Deprecated(since="9", forRemoval=true)
     @ForceInline
     public Class<?> defineClass(String name, byte[] b, int off, int len,
                                 ClassLoader loader,