RFR: 8302791: Add specific ClassLoader object to Proxy IllegalArgumentException message [v4]

Alan Bateman alanb at openjdk.org
Wed Mar 1 15:11:16 UTC 2023


On Wed, 1 Mar 2023 10:10:12 GMT, Ravali Yatham <duke at 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
>
> Ravali Yatham has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Add comments

src/java.base/share/classes/java/lang/reflect/Proxy.java line 889:

> 887:                                                     : Objects.toIdentityString(ld);
> 888:                 throw new IllegalArgumentException(c.getName() +
> 889:                         " referenced from a method is not visible from class loader: " + nid);

Thanks for the update, this looks much better. A passing thought is that you might want to use "/" instead of "@" as the separator so that someone looking at the exception message will be able to distinguish a class name from a class loader name. Also you might want to re-format L886 to avoid the really long line as it's a bit inconsistent with the code in this source file.

-------------

PR: https://git.openjdk.org/jdk/pull/12641


More information about the core-libs-dev mailing list