--- old/src/jdk.unsupported/share/classes/sun/misc/Unsafe.java 2019-10-08 18:53:48.000000000 -0700 +++ new/src/jdk.unsupported/share/classes/sun/misc/Unsafe.java 2019-10-08 18:53:47.000000000 -0700 @@ -30,6 +30,7 @@ import jdk.internal.reflect.CallerSensitive; import jdk.internal.reflect.Reflection; +import java.lang.invoke.MethodHandles; import java.lang.reflect.Field; import java.util.Set; @@ -820,11 +821,16 @@ *
  • String: any object (not just a java.lang.String) *
  • InterfaceMethodRef: (NYI) a method handle to invoke on that call site's arguments * + * + * @deprecated Use the {@link java.lang.invoke.MethodHandles.Lookup#defineHiddenClass(byte[], boolean, MethodHandles.Lookup.ClassOption...)} + * method. + * * @param hostClass context for linkage, access control, protection domain, and class loader * @param data bytes of a class file * @param cpPatches where non-null entries exist, they replace corresponding CP entries in data */ @ForceInline + @Deprecated(since = "14", forRemoval = false) public Class defineAnonymousClass(Class hostClass, byte[] data, Object[] cpPatches) { return theInternalUnsafe.defineAnonymousClass(hostClass, data, cpPatches); }