RFR: 8353835: Implement JEP 500: Prepare to Make Final Mean Final [v4]

Alan Bateman alanb at openjdk.org
Tue Sep 30 10:11:08 UTC 2025


On Mon, 29 Sep 2025 19:19:02 GMT, Volkan Yazici <vyazici at openjdk.org> wrote:

>> Alan Bateman has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   RemoveFields(duration) and filter internal frames
>
> test/jdk/java/lang/reflect/Field/mutateFinals/FinalFieldMutationEventTest.java line 79:
> 
>> 77:             recording.enable(EVENT_NAME).withStackTrace();
>> 78: 
>> 79:             boolean mutated = false;
> 
> Instead of relying on `IAE` to be thrown as expected, you may consider passing `mutated` flag in `@run` (`-DwriteAccess`?) and using it to double-check the programmatically computed `mutated`.

The test checks that an event is recorded when a final field is mutated (or unreflected on for setting), or that no event is recorded if not mutated.  We could do as you suggest and also have it check if the mutation was expected or not but it would expand the scope and overlap with other tests. So I think it's okay as in.

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

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


More information about the core-libs-dev mailing list