--- old/src/java.base/share/classes/java/lang/reflect/Proxy.java 2019-05-15 13:57:51.859775807 -0400 +++ new/src/java.base/share/classes/java/lang/reflect/Proxy.java 2019-05-15 13:57:51.479773922 -0400 @@ -849,11 +849,11 @@ private static void ensureVisible(ClassLoader ld, Class c) { Class type = null; try { + if (c.isInlineClass() && c.isNullableType()) c = c.asPrimaryType(); type = Class.forName(c.getName(), false, ld); } catch (ClassNotFoundException e) { } - // use box type to do visibility check - if (type != c.asBoxType()) { + if (type != c) { throw new IllegalArgumentException(c.getName() + " referenced from a method is not visible from class loader"); }