8035734: [parfait] JNI exception pending in jdk/src/windows/native/sun/windows/awt_Choice.cpp
authorpchelko
Thu, 10 Apr 2014 11:56:01 +0400
changeset 24173 176b551268a3
parent 24172 814fb69fa9a5
child 24174 ea4435b45c3e
8035734: [parfait] JNI exception pending in jdk/src/windows/native/sun/windows/awt_Choice.cpp Reviewed-by: anthony, serb
jdk/src/windows/native/sun/windows/awt_Choice.cpp
--- a/jdk/src/windows/native/sun/windows/awt_Choice.cpp	Wed Apr 09 18:20:55 2014 +0400
+++ b/jdk/src/windows/native/sun/windows/awt_Choice.cpp	Thu Apr 10 11:56:01 2014 +0400
@@ -157,6 +157,7 @@
                                                      "preferredSize",
                                                      "()Ljava/awt/Dimension;").l;
             DASSERT(!safe_ExceptionOccurred(env));
+            if (env->ExceptionCheck()) goto done;
 
             if (dimension != NULL && width == 0) {
                 width = env->GetIntField(dimension, AwtDimension::widthID);
@@ -337,9 +338,8 @@
                                              "preferredSize",
                                              "()Ljava/awt/Dimension;").l;
     DASSERT(!safe_ExceptionOccurred(env));
-    if (dimension == NULL) {
-        return NULL;
-    }
+    CHECK_NULL_RETURN(dimension, NULL);
+
     /* This size is window size of choice and it's too big for each
      * drop down item height.
      */
@@ -605,7 +605,8 @@
            for (i = 0; i < itemCount; i++)
            {
                jstring item = (jstring)env->GetObjectArrayElement(items, i);
-               JNI_CHECK_NULL_GOTO(item, "null item", next_elem);
+               if (env->ExceptionCheck()) goto done;
+               if (item == NULL) goto next_elem;
                c->SendMessage(CB_INSERTSTRING, index + i, JavaStringBuffer(env, item));
                env->DeleteLocalRef(item);
 next_elem: