Integrated: 8319436: Proxy.newProxyInstance throws NPE if loader is null and interface not visible from class loader

Mandy Chung mchung at openjdk.org
Tue Nov 7 17:02:42 UTC 2023


On Mon, 6 Nov 2023 19:12:28 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.

This pull request has now been integrated.

Changeset: 8eb6f617
Author:    Mandy Chung <mchung at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/8eb6f617b3f8e2a990e4244af4e56287f9741b20
Stats:     143 lines in 2 files changed: 20 ins; 77 del; 46 mod

8319436: Proxy.newProxyInstance throws NPE if loader is null and interface not visible from class loader

Reviewed-by: alanb

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

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


More information about the core-libs-dev mailing list