On Wed, 22 Feb 2023 07:24:48 GMT, Alan Bateman <al...@openjdk.org> wrote:
>> Added specific class loader object to proxy IllegalArgumentException from >> which the class was not visible >> >> The bug report for the same: https://bugs.openjdk.org/browse/JDK-8302791 > > src/java.base/share/classes/java/lang/reflect/Proxy.java line 881: > >> 879: if (type != c) { >> 880: throw new IllegalArgumentException(c.getName() + >> 881: " referenced from a method is not visible from >> class loader: " + ld); > > The ClassLoader string representation may or may not be useful here. One > suggestion is to use the class loader name (ld.getName()) if not null, > otherwise Objects.toIdentityString(ld). I also think it's helpful to print the name of class loader if present, or the identity string as Alan suggests. ------------- PR: https://git.openjdk.org/jdk/pull/12641