On Wed, 10 Jun 2026 15:39:57 GMT, Alan Bateman <[email protected]> wrote:

>> I am advertising MethodHandles as the preferred alternative to legacy 
>> reflective invocation instead of comparing the two; I am trying to emphasize 
>> the correct owner is being checked. I don't think your proposed refactor 
>> accomplishes the goal better, but some refactoring is definitely necessary 
>> because you failed to see this as an advertisement.
>
> A significant difference between the old and new reflection APIs is where the 
> access check is done. Right now the section has this topic in the first 
> paragraph (old reflection) and last paragraph (new reflection). It feels like 
> the first two sentences in the last paragraph should follow the first section 
> of the first paragraph. I think that will fix the structural issue with this 
> section, and help with your goal to promote the use of method handles 
> (someone reading this should be able to quickly see that there aren't any 
> access checks once they obtain the method handle).

Indeed, since I have advertised MethodHandle very early on before this section, 
I should split up this paragraph and inject throughout. I can split the "time 
of check" and "class checked" into two paragraphs, and compare the core 
reflection vs MethodHandle behavior for each of these in the same paragraph. 
Same for the final example.

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

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

Reply via email to