<AWT Dev> RFR: 8170493: JNI exception pending in JavaComponentAccessibility.m:142

Prasanta Sadhukhan prasanta.sadhukhan at oracle.com
Mon Jan 16 06:32:16 UTC 2017


looks good to me.

Regards
Prasanta
On 1/14/2017 5:46 AM, Philip Race wrote:
> silences a hypothetical problem of a NULL return in an out-of-memory 
> situation.
> This was detected by static analysis, not an actualy observed problem.
>
> bug : https://bugs.openjdk.java.net/browse/JDK-8170493
> diff :
> a/src/java.desktop/macosx/native/libawt_lwawt/awt/JavaComponentAccessibility.m 
>
> +++ 
> b/src/java.desktop/macosx/native/libawt_lwawt/awt/JavaComponentAccessibility.m
> @@ -45,6 +45,7 @@
>  #import "JavaTextAccessibility.h"
>  #import "ThreadUtilities.h"
>  #import "AWTView.h"
> +#import "jni_util.h"
>
>
>  // these constants are duplicated in CAccessibility.java
> @@ -136,7 +137,7 @@
>          fJavaRole = [javaRole retain];
>
>          fAccessible = (*env)->NewWeakGlobalRef(env, accessible);
> -
> +        if (accessible != NULL) CHECK_NULL_RETURN(fAccessible, self);
>          jobject jcomponent = [(AWTView *)fView awtComponent:env];
>          fComponent = (*env)->NewWeakGlobalRef(env, jcomponent);
>          (*env)->DeleteLocalRef(env, jcomponent);
>



More information about the awt-dev mailing list