On Wed, 12 Nov 2025 12:51:37 GMT, Viktor Klang <[email protected]> wrote:

>> Alan Bateman has updated the pull request with a new target base due to a 
>> merge or a rebase. The pull request now contains 50 commits:
>> 
>>  - Remove dup end body tag
>>  - Change FinalFieldMutationEvent so that caller is top frame in stack trace
>>  - Merge branch 'master' into JDK-8353835
>>  - Review feedback: Add tests for setting internal properties, improve links 
>> in Mutation methods page
>>  - Merge branch 'master' into JDK-8353835
>>  - Merge branch 'master' into JDK-8353835
>>  - Fix typo in test comment
>>  - Merge branch 'master' into JDK-8353835
>>  - Merge branch 'master' into JDK-8353835
>>  - Suppress warnings from some tests
>>  - ... and 40 more: https://git.openjdk.org/jdk/compare/2902436f...b22947c7
>
> src/java.base/share/classes/java/lang/reflect/Field.java line 1543:
> 
>> 1541:      * the given possibly-null caller.
>> 1542:      */
>> 1543:     private String finalFieldMutationWarning(Class<?> caller, boolean 
>> unreflect) {
> 
> It may make sense to have this method return a StringBuilder instance (and 
> use it internally before returning it) as that would cut down on extra 
> String-instance creation.

We could but this is the slow path that prints the warning on the first final 
field mutation. So I think I'll keep it as simple as possible.

> src/java.base/share/man/java.md line 482:
> 
>> 480: 
>> 481:     -   `allow`: This mode allows illegal final field mutation in all 
>> modules,
>> 482:         without any warings.
> 
> Suggestion:
> 
>         without any warnings.

Well spotted, this text was copied down `--illegal-native-access` so I'll fix 
the typo in both places.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/25115#discussion_r2523476042
PR Review Comment: https://git.openjdk.org/jdk/pull/25115#discussion_r2523469262

Reply via email to