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

Philip Race philip.race at oracle.com
Sat Jan 14 00:16:24 UTC 2017


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