RFR: 8319436: Proxy.newProxyInstance throws NPE if loader is null and interface not visible from class loader [v2]
Alan Bateman
alanb at openjdk.org
Tue Nov 7 07:56:35 UTC 2023
On Mon, 6 Nov 2023 20:22:43 GMT, Mandy Chung <mchung at openjdk.org> wrote:
>> This is a regression caused by JDK-8302791. IAE should be thrown when an interface is not visible to the given class loader but NPE is thrown instead when the loader is null. The boot loader has no name and so the fix will print `null` in the exception message. `test/jdk/java/lang/reflect/Proxy/ClassRestrictions.java` is converted to junit and updated to test IAE thrown because proxy interface is not visible to null loader.
>
> Mandy Chung has updated the pull request incrementally with one additional commit since the last revision:
>
> Review feedback
The fix to getLoaderNameID looks fine, the update and conversion of the test looks okay too.
-------------
Marked as reviewed by alanb (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/16525#pullrequestreview-1717031599
More information about the core-libs-dev
mailing list