RFR: 8212961: [TESTBUG] vmTestbase/nsk/stress/jni/ native code cleanup [v2]

David Holmes dholmes at openjdk.java.net
Fri Jul 23 05:53:09 UTC 2021


On Fri, 23 Jul 2021 05:38:17 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:

>> David Holmes has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Restored 'dead code' that led to compilation failure on Windows
>
> Looks good, small remarks inside.
> 
> Cheers, Thomas

Thanks for looking at this @tstuefe !

> test/hotspot/jtreg/vmTestbase/nsk/stress/jni/libjnistress001.cpp line 250:
> 
>> 248:   }
>> 249:   CHECK(env->MonitorExit(jobj));
>> 250:   return env->NewString(javachars->str[index - 1], elem_len);
> 
> Should you check for exceptions after NewString?

It isn't essential as any exception will be thrown in the calling Java code. It won't be as fail-fast as using CE but doesn't seem worth the effort to change.

> test/hotspot/jtreg/vmTestbase/nsk/stress/jni/libjnistress003.cpp line 89:
> 
>> 87:     } else {
>> 88:       boolBuf[i] = JNI_FALSE;
>> 89:     }
> 
> Shorten to `boolBuf[i] = (i % 2) ? JNI_TRUE : JNI_FALSE` ?

Sure :)

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

PR: https://git.openjdk.java.net/jdk/pull/4882


More information about the hotspot-runtime-dev mailing list