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

Ravali Yatham duke at openjdk.org
Thu Mar 2 10:32:52 UTC 2023


On Wed, 1 Mar 2023 15:08:02 GMT, Alan Bateman <alanb at openjdk.org> wrote:

>> 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.

Thanks @AlanBateman. Regarding the separator, Have seen this being used in ClassLoader.java for nameAndId method. Hence used the same for consistency. I've reformatted L886 now, Please kindly check.

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

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


More information about the core-libs-dev mailing list