On Sun, 7 Jun 2026 14:10:51 GMT, Chen Liang <[email protected]> wrote:

>> Core reflection has its own type conversion behavior that is somewhat poorly 
>> specified; it is scattered around a few places, and its boxing and unboxing 
>> deviates from that of Java language assignment contexts. In addition, core 
>> reflection has a somewhat erroneous access check system. We can improve the 
>> overview of java.lang.reflect to address these shortcomings and recommend 
>> users to use java.lang.invoke for better functionality in these areas.
>> 
>> ---------
>> - [x] I confirm that I make this contribution in accordance with the 
>> [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai).
>
> Chen Liang has updated the pull request incrementally with two additional 
> commits since the last revision:
> 
>  - Years
>  - Formatting and add an example

src/java.base/share/classes/java/lang/reflect/package-info.java line 73:

> 71:  * to produce a {@link MethodHandle} that performs no additional access 
> checks.
> 72:  * If the accessed declaration is a member, the single check is performed
> 73:  * against the correct class or interface of the member.  In the example 
> above,

The new AC section starts with text to show that reflect APIs are caller 
sensitive and there is access check at each call.  It feels like sentences on 
when the access check is done with method handles should follow that. I think 
that would flow better so that the issue can inherited methods isn't in the 
middle of the section.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/28685#discussion_r3389470226

Reply via email to