On Tue, 30 Sep 2025 08:44:45 GMT, Volkan Yazici <[email protected]> wrote:

>> The comment in the test description has ".. to avoid starting a child VM to 
>> test every mutation method". I'll see if I can improve this comment to make 
>> it clearer, or maybe your comment is that the method source needs this 
>> comment too?
>> 
>> The context here is that the test is launching a VM with -Xcheck:jni to 
>> check that it terminates with a "FATAL ERROR in native method".  Doing this 
>> for each of 18 cases would be expensive, can be 30+ seconds on macOS systems 
>> with debug builds. To keep the test execution down, the test choses one JNI 
>> function that attempts to mutate a final instance field, and one JNI 
>> function that attempts to mutate a static final field. The ensures the 
>> instance + static implementations are tested on each run. There is template 
>> expansion, and all functions will get exercised with enough runs.
>
> I was curious why in particular `instance+static`, but not, say, 
> `static+instance`, or `static1+instance1+static2+static3+instance3`, etc. 
> That is, does checking the static field *after* the instance field have any 
> significance. But AFAIU from your explanation, it does not. I don't have any 
> further remarks.

Right, the ordering doesn't matter it has to launch a new VM for each 
-Xcheck:jni test (necessary because the terminates with a fatal error when 
attempting to mutate a final field).

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

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

Reply via email to