-
Enhancement
-
Resolution: Unresolved
-
P4
-
17, 20
-
None
-
In Review
-
generic
-
generic
We have a number of places in the codebase following this pattern :
java.desktop/share/native/libawt/awt/image/BufImgSurfaceData.c:371: if ((*env)->ExceptionCheck(env))
java.desktop/share/native/libawt/awt/image/BufImgSurfaceData.c-372- {
java.desktop/share/native/libawt/awt/image/BufImgSurfaceData.c-373- free(cData);
java.desktop/share/native/libawt/awt/image/BufImgSurfaceData.c-374- return (ColorData*)NULL;
java.security.jgss/share/native/libj2gss/NativeUtil.c:609: if ((*env)->ExceptionCheck(env)) {
java.security.jgss/share/native/libj2gss/NativeUtil.c-610- free(value);
java.security.jgss/share/native/libj2gss/NativeUtil.c-611- return;
java.smartcardio/share/native/libj2pcsc/pcsc.c:163: if ((*env)->ExceptionCheck(env)) {
java.smartcardio/share/native/libj2pcsc/pcsc.c-164- free(tab);
java.smartcardio/share/native/libj2pcsc/pcsc.c-165- return NULL;
java.smartcardio/share/native/libj2pcsc/pcsc.c-166- }
jdk.crypto.cryptoki/share/native/libj2pkcs11/p11_convert.c:1625: if ((*env)->ExceptionCheck(env)) {
jdk.crypto.cryptoki/share/native/libj2pkcs11/p11_convert.c-1626- free(ckParamPtr);
jdk.crypto.cryptoki/share/native/libj2pkcs11/p11_convert.c-1627- return NULL;
jdk.crypto.cryptoki/share/native/libj2pkcs11/p11_convert.c-1628- }
...
This could be simplified by providing a macro JNU_CHECK_EXCEPTION_FREE_RETURN (additionally to the existing JNU_CHECK_EXCEPTION_RETURN).
java.desktop/share/native/libawt/awt/image/BufImgSurfaceData.c:371: if ((*env)->ExceptionCheck(env))
java.desktop/share/native/libawt/awt/image/BufImgSurfaceData.c-372- {
java.desktop/share/native/libawt/awt/image/BufImgSurfaceData.c-373- free(cData);
java.desktop/share/native/libawt/awt/image/BufImgSurfaceData.c-374- return (ColorData*)NULL;
java.security.jgss/share/native/libj2gss/NativeUtil.c:609: if ((*env)->ExceptionCheck(env)) {
java.security.jgss/share/native/libj2gss/NativeUtil.c-610- free(value);
java.security.jgss/share/native/libj2gss/NativeUtil.c-611- return;
java.smartcardio/share/native/libj2pcsc/pcsc.c:163: if ((*env)->ExceptionCheck(env)) {
java.smartcardio/share/native/libj2pcsc/pcsc.c-164- free(tab);
java.smartcardio/share/native/libj2pcsc/pcsc.c-165- return NULL;
java.smartcardio/share/native/libj2pcsc/pcsc.c-166- }
jdk.crypto.cryptoki/share/native/libj2pkcs11/p11_convert.c:1625: if ((*env)->ExceptionCheck(env)) {
jdk.crypto.cryptoki/share/native/libj2pkcs11/p11_convert.c-1626- free(ckParamPtr);
jdk.crypto.cryptoki/share/native/libj2pkcs11/p11_convert.c-1627- return NULL;
jdk.crypto.cryptoki/share/native/libj2pkcs11/p11_convert.c-1628- }
...
This could be simplified by providing a macro JNU_CHECK_EXCEPTION_FREE_RETURN (additionally to the existing JNU_CHECK_EXCEPTION_RETURN).
- links to
-
Review openjdk/jdk/11539