changeset 10342:2f6a39955406

8064698: [parfait] JNI exception pending in jdk/src/java/desktop/unix/native: libawt_xawt/awt/, common/awt Reviewed-by: alexsch, serb
author azvegint
date Tue, 02 Dec 2014 12:47:12 +0300
parents 29801793a0b0
children 0870f96a7b0e
files src/solaris/native/sun/awt/awt_Event.c src/solaris/native/sun/awt/awt_Font.c src/solaris/native/sun/awt/awt_GraphicsEnv.c src/solaris/native/sun/awt/sun_awt_X11_GtkFileDialogPeer.c
diffstat 4 files changed, 16 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/solaris/native/sun/awt/awt_Event.c	Mon Dec 15 16:00:53 2014 +0300
+++ b/src/solaris/native/sun/awt/awt_Event.c	Tue Dec 02 12:47:12 2014 +0300
@@ -42,7 +42,7 @@
 JNIEXPORT void JNICALL
 Java_java_awt_Event_initIDs(JNIEnv *env, jclass cls)
 {
-    eventIDs.data = (*env)->GetFieldID(env, cls, "data", "J");
-    eventIDs.consumed = (*env)->GetFieldID(env, cls, "consumed", "Z");
-    eventIDs.id = (*env)->GetFieldID(env, cls, "id", "I");
+    CHECK_NULL(eventIDs.data = (*env)->GetFieldID(env, cls, "data", "J"));
+    CHECK_NULL(eventIDs.consumed = (*env)->GetFieldID(env, cls, "consumed", "Z"));
+    CHECK_NULL(eventIDs.id = (*env)->GetFieldID(env, cls, "id", "I"));
 }
--- a/src/solaris/native/sun/awt/awt_Font.c	Mon Dec 15 16:00:53 2014 +0300
+++ b/src/solaris/native/sun/awt/awt_Font.c	Tue Dec 02 12:47:12 2014 +0300
@@ -579,6 +579,7 @@
         Disposer_AddRecord(env, font, pDataDisposeMethod, ptr_to_jlong(fdata));
         return fdata;
     } else {
+        JNU_CHECK_EXCEPTION_RETURN(env, NULL);
         Display *display = NULL;
         struct FontData *fdata = NULL;
         char fontSpec[1024];
--- a/src/solaris/native/sun/awt/awt_GraphicsEnv.c	Mon Dec 15 16:00:53 2014 +0300
+++ b/src/solaris/native/sun/awt/awt_GraphicsEnv.c	Tue Dec 02 12:47:12 2014 +0300
@@ -23,6 +23,7 @@
  * questions.
  */
 
+#include "jni_util.h"
 #include "awt_p.h"
 #include "awt.h"
 #include "color.h"
@@ -763,6 +764,7 @@
     XSetIOErrorHandler(xioerror_handler);
     JNU_CallStaticMethodByName(env, NULL, "sun/awt/X11/XErrorHandlerUtil", "init", "(J)V",
         ptr_to_jlong(awt_display));
+    JNU_CHECK_EXCEPTION_RETURN(env, NULL);
 
     /* set awt_numScreens, and whether or not we're using Xinerama */
     xineramaInit();
@@ -789,6 +791,7 @@
             x11Screens[i].root = RootWindow(awt_display, i);
         }
         x11Screens[i].defaultConfig = makeDefaultConfig(env, i);
+        JNU_CHECK_EXCEPTION_RETURN(env, NULL);
     }
 
     return dpy;
--- a/src/solaris/native/sun/awt/sun_awt_X11_GtkFileDialogPeer.c	Mon Dec 15 16:00:53 2014 +0300
+++ b/src/solaris/native/sun/awt/sun_awt_X11_GtkFileDialogPeer.c	Tue Dec 02 12:47:12 2014 +0300
@@ -72,6 +72,11 @@
 
 static void quit(JNIEnv * env, jobject jpeer, gboolean isSignalHandler)
 {
+    jthrowable pendingException;
+    if (pendingException = (*env)->ExceptionOccurred(env)) {
+         (*env)->ExceptionClear(env);
+    }
+
     GtkWidget * dialog = (GtkWidget*)jlong_to_ptr(
             (*env)->GetLongField(env, jpeer, widgetFieldID));
 
@@ -95,6 +100,10 @@
             fp_gdk_threads_leave();
         }
     }
+
+    if (pendingException) {
+         (*env)->Throw(env, pendingException);
+    }
 }
 
 /*