RFR: 8349716: IllegalAccessError when Proxy methods return object of a package-private type
Hendrik Schick
duke at openjdk.org
Sun Apr 13 15:54:23 UTC 2025
On Sun, 13 Apr 2025 09:49:46 GMT, Chen Liang <liach at openjdk.org> wrote:
> Proxy currently places proxy classes that proxy interfaces with package-private return types in dynamic modules. This means that if a return value is non-null, Proxy cannot return it and throws IllegalAccessError.
>
> This patch changes strategy so proxy classes for any reference to package-private types (in parameter or return) are now considered as package-private, tightening the restrictions on proxy factories.
test/jdk/java/lang/annotation/WithPackagePrivateTest.java line 44:
> 42:
> 43: /**
> 44: * Test public annotations that has elements of package-private types.
Suggestion:
* Test public annotations that have elements of package-private types.
test/jdk/java/lang/reflect/Proxy/NonPublicMethodTypeTest.java line 1:
> 1: /*
update copyright to 2025 aswell
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/24611#discussion_r2041144035
PR Review Comment: https://git.openjdk.org/jdk/pull/24611#discussion_r2041144939
More information about the core-libs-dev
mailing list