diff -r 5a8499c4b32c -r c6761862ca0b jdk/src/java.base/share/classes/java/lang/ClassLoader.java --- a/jdk/src/java.base/share/classes/java/lang/ClassLoader.java Thu Mar 16 16:34:36 2017 +0000 +++ b/jdk/src/java.base/share/classes/java/lang/ClassLoader.java Wed Mar 22 16:26:27 2017 +0000 @@ -983,7 +983,7 @@ { protectionDomain = preDefineClass(name, protectionDomain); String source = defineClassSourceLocation(protectionDomain); - Class c = defineClass1(name, b, off, len, protectionDomain, source); + Class c = defineClass1(this, name, b, off, len, protectionDomain, source); postDefineClass(c, protectionDomain); return c; } @@ -1075,17 +1075,17 @@ protectionDomain = preDefineClass(name, protectionDomain); String source = defineClassSourceLocation(protectionDomain); - Class c = defineClass2(name, b, b.position(), len, protectionDomain, source); + Class c = defineClass2(this, name, b, b.position(), len, protectionDomain, source); postDefineClass(c, protectionDomain); return c; } - private native Class defineClass1(String name, byte[] b, int off, int len, - ProtectionDomain pd, String source); + static native Class defineClass1(ClassLoader loader, String name, byte[] b, int off, int len, + ProtectionDomain pd, String source); - private native Class defineClass2(String name, java.nio.ByteBuffer b, - int off, int len, ProtectionDomain pd, - String source); + static native Class defineClass2(ClassLoader loader, String name, java.nio.ByteBuffer b, + int off, int len, ProtectionDomain pd, + String source); // true if the name is null or has the potential to be a valid binary name private boolean checkName(String name) {