OpenJDK / jdk8u / jdk8u / jdk
changeset 9857:305a9ed62593
8046884: JNI exception pending in jdk/src/solaris/native/sun/java2d/x11: X11PMPLitLoops.c, X11SurfaceData.c
Reviewed-by: prr, serb
author | pchelko |
---|---|
date | Mon, 21 Jul 2014 21:41:11 +0400 |
parents | aa2dfbaf6340 |
children | 9d09209061d2 |
files | src/solaris/native/sun/java2d/x11/X11PMBlitLoops.c src/solaris/native/sun/java2d/x11/X11SurfaceData.c |
diffstat | 2 files changed, 29 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/src/solaris/native/sun/java2d/x11/X11PMBlitLoops.c Tue Jul 22 09:21:33 2014 +0400 +++ b/src/solaris/native/sun/java2d/x11/X11PMBlitLoops.c Mon Jul 21 21:41:11 2014 +0400 @@ -241,9 +241,12 @@ width, height, 1); if (xsdo->bitmask == 0) { AWT_UNLOCK(); - JNU_ThrowOutOfMemoryError(env, - "Cannot create bitmask for " - "offscreen surface"); + if (!(*env)->ExceptionCheck(env)) + { + JNU_ThrowOutOfMemoryError(env, + "Cannot create bitmask for " + "offscreen surface"); + } return; } } @@ -253,7 +256,10 @@ 1, XYBitmap, 0, NULL, width, height, 32, 0); if (image == NULL) { AWT_UNLOCK(); - JNU_ThrowOutOfMemoryError(env, "Cannot allocate bitmask for mask"); + if (!(*env)->ExceptionCheck(env)) + { + JNU_ThrowOutOfMemoryError(env, "Cannot allocate bitmask for mask"); + } return; } dstScan = image->bytes_per_line; @@ -261,7 +267,10 @@ if (image->data == NULL) { XFree(image); AWT_UNLOCK(); - JNU_ThrowOutOfMemoryError(env, "Cannot allocate bitmask for mask"); + if (!(*env)->ExceptionCheck(env)) + { + JNU_ThrowOutOfMemoryError(env, "Cannot allocate bitmask for mask"); + } return; } pDst = (unsigned char *)image->data;
--- a/src/solaris/native/sun/java2d/x11/X11SurfaceData.c Tue Jul 22 09:21:33 2014 +0400 +++ b/src/solaris/native/sun/java2d/x11/X11SurfaceData.c Mon Jul 21 21:41:11 2014 +0400 @@ -454,6 +454,7 @@ AWT_LOCK(); xsdo->drawable = X11SD_CreateSharedPixmap(xsdo); AWT_UNLOCK(); + JNU_CHECK_EXCEPTION_RETURN(env, JNI_FALSE); if (xsdo->drawable) { xsdo->shmPMData.usingShmPixmap = JNI_TRUE; xsdo->shmPMData.shmPixmap = xsdo->drawable; @@ -469,6 +470,7 @@ xsdo->configData->awt_visInfo.screen), width, height, depth); AWT_UNLOCK(); + JNU_CHECK_EXCEPTION_RETURN(env, JNI_FALSE); #ifdef MITSHM xsdo->shmPMData.usingShmPixmap = JNI_FALSE; xsdo->shmPMData.pixmap = xsdo->drawable; @@ -504,6 +506,7 @@ if (xsdo->configData->awt_cmap == (Colormap)NULL) { awtJNI_CreateColorData(env, xsdo->configData, 1); + JNU_CHECK_EXCEPTION(env); } /* color_data will be initialized in awtJNI_CreateColorData for 8-bit visuals */ @@ -805,7 +808,10 @@ xsdo->cData->awt_icmLUT == NULL)) { AWT_UNLOCK(); - JNU_ThrowNullPointerException(env, "colormap lookup table"); + if (!(*env)->ExceptionCheck(env)) + { + JNU_ThrowNullPointerException(env, "colormap lookup table"); + } return SD_FAILURE; } if ((lockflags & SD_LOCK_INVCOLOR) != 0 && @@ -816,7 +822,10 @@ xsdo->cData->img_oda_blue == NULL)) { AWT_UNLOCK(); - JNU_ThrowNullPointerException(env, "inverse colormap lookup table"); + if (!(*env)->ExceptionCheck(env)) + { + JNU_ThrowNullPointerException(env, "inverse colormap lookup table"); + } return SD_FAILURE; } if ((lockflags & SD_LOCK_INVGRAY) != 0 && @@ -824,7 +833,10 @@ xsdo->cData->pGrayInverseLutData == NULL)) { AWT_UNLOCK(); - JNU_ThrowNullPointerException(env, "inverse gray lookup table"); + if (!(*env)->ExceptionCheck(env)) + { + JNU_ThrowNullPointerException(env, "inverse gray lookup table"); + } return SD_FAILURE; } if (xsdo->dgaAvailable && (lockflags & (SD_LOCK_RD_WR))) {