RFR: 8349716: IllegalAccessError when Proxy methods return object of a package-private type
Chen Liang
liach at openjdk.org
Sun Apr 13 15:54:22 UTC 2025
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.
-------------
Commit messages:
- Update test/jdk/java/lang/annotation/WithPackagePrivateTest.java
- Make package private if any referenced type is
- Test suite
Changes: https://git.openjdk.org/jdk/pull/24611/files
Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=24611&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8349716
Stats: 393 lines in 10 files changed: 274 ins; 53 del; 66 mod
Patch: https://git.openjdk.org/jdk/pull/24611.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/24611/head:pull/24611
PR: https://git.openjdk.org/jdk/pull/24611
More information about the core-libs-dev
mailing list