RFR: 8131136: java/awt/font/JNICheck/JNICheck.sh issue warning on core-libs code

Sergey Bylokhov serb at openjdk.org
Wed Jun 11 19:03:30 UTC 2025


On Wed, 11 Jun 2025 13:19:39 GMT, Daniel Jeliński <djelinski at openjdk.org> wrote:

>> Add an exception check after a JNI static method call, and re-enable checks for CallStatic in JNICheck.sh test.
>> 
>> I verified that the JNICheck test is passing on all headless and headful platforms I had access to (Windows, Linux and Mac). Other tier1-3 tests also continue to pass.
>
> src/java.base/share/native/libnet/net_util.c line 77:
> 
>> 75:     CHECK_NULL_RETURN(s, JNI_VERSION_1_2);
>> 76:     preferIPv4Stack = (*env)->CallStaticBooleanMethod(env, iCls, mid, s);
>> 77:     JNU_CHECK_EXCEPTION_RETURN(env, JNI_VERSION_1_2);
> 
> The exception check is technically not necessary because no other JNI methods are called before the function exits, but it wasn't always the case.

If this check is not needed, then why are we adding it?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/25754#discussion_r2140875632


More information about the client-libs-dev mailing list