JDK-8260600 : Release Note: Proxy Classes Are Not Open for Reflective Access
  • Type: Sub-task
  • Component: core-libs
  • Sub-Component: java.lang:reflect
  • Affected Version: 16
  • Priority: P4
  • Status: Closed
  • Resolution: Delivered
  • Submitted: 2021-01-28
  • Updated: 2021-12-05
  • Resolved: 2021-12-05
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 16
16Resolved
Description
All proxy classes are not open for reflective access in Java SE 16.   

Prior to Java SE 16, if `java.lang.reflect.Proxy` was used to implement only public exported proxy interfaces, the proxy class was generated in an unnamed module which was open for reflective access. In Java SE 16, the proxy class is generated in an exported package in a named module.  Programs that assume the private members of a proxy class can be made accessible via `setAccessible(true)` will fail with `InaccessibleObjectException`. Proxy classes are already defined in dynamic modules in other cases since Java SE 9.   Such programs would already fail when it calls `setAccessible(true)` to those proxy classes prior to this change.