8341790: Fix ExceptionOccurred in java.desktop

Reviewed-by: avu, prr
This commit is contained in:
Laurent Bourgès 2024-11-14 06:38:37 +00:00
parent 1e97c1c913
commit 23a8c71d3b
27 changed files with 76 additions and 96 deletions

View File

@ -449,7 +449,7 @@ awt_x11inputmethod_lookupString(XKeyPressedEvent *event, KeySym *keysymp)
"(Ljava/lang/String;J)V",
javastr,
event->time);
if ((*env)->ExceptionOccurred(env)) {
if ((*env)->ExceptionCheck(env)) {
(*env)->ExceptionDescribe(env);
(*env)->ExceptionClear(env);
}
@ -682,7 +682,7 @@ static void onoffStatusWindow(X11InputMethodData* pX11IMData,
parent = JNU_CallMethodByName(env, NULL, pX11IMData->x11inputmethod,
"getCurrentParentWindow",
"()J").j;
if ((*env)->ExceptionOccurred(env)) {
if ((*env)->ExceptionCheck(env)) {
(*env)->ExceptionDescribe(env);
(*env)->ExceptionClear(env);
}
@ -1057,7 +1057,7 @@ PreeditDoneCallback(XIC ic, XPointer client_data, XPointer call_data)
"clearComposedText",
"(J)V",
awt_util_nowMillisUTC());
if ((*env)->ExceptionOccurred(env)) {
if ((*env)->ExceptionCheck(env)) {
(*env)->ExceptionDescribe(env);
(*env)->ExceptionClear(env);
}
@ -1160,7 +1160,7 @@ PreeditDrawCallback(XIC ic, XPointer client_data,
(jint)pre_draw->caret,
awt_util_nowMillisUTC());
if ((*env)->ExceptionOccurred(env)) {
if ((*env)->ExceptionCheck(env)) {
(*env)->ExceptionDescribe(env);
(*env)->ExceptionClear(env);
}
@ -2125,7 +2125,7 @@ JNIEXPORT jstring JNICALL Java_sun_awt_X11InputMethodBase_resetXIC
JNU_CallMethodByName(env, NULL, pX11IMData->x11inputmethod,
"clearComposedText",
"()V");
if ((*env)->ExceptionOccurred(env)) {
if ((*env)->ExceptionCheck(env)) {
(*env)->ExceptionDescribe(env);
(*env)->ExceptionClear(env);
}

View File

@ -515,23 +515,6 @@ static BOOL shouldUsePressAndHold() {
[super drawRect:dirtyRect];
JNIEnv *env = [ThreadUtilities getJNIEnv];
if (env != NULL) {
/*
if ([self inLiveResize]) {
NSRect rs[4];
NSInteger count;
[self getRectsExposedDuringLiveResize:rs count:&count];
for (int i = 0; i < count; i++) {
JNU_CallMethodByName(env, NULL, [m_awtWindow cPlatformView],
"deliverWindowDidExposeEvent", "(FFFF)V",
(jfloat)rs[i].origin.x, (jfloat)rs[i].origin.y,
(jfloat)rs[i].size.width, (jfloat)rs[i].size.height);
if ((*env)->ExceptionOccurred(env)) {
(*env)->ExceptionDescribe(env);
(*env)->ExceptionClear(env);
}
}
} else {
*/
DECLARE_CLASS(jc_CPlatformView, "sun/lwawt/macosx/CPlatformView");
DECLARE_METHOD(jm_deliverWindowDidExposeEvent, jc_CPlatformView, "deliverWindowDidExposeEvent", "()V");
jobject jlocal = (*env)->NewLocalRef(env, m_cPlatformView);
@ -540,9 +523,6 @@ static BOOL shouldUsePressAndHold() {
CHECK_EXCEPTION();
(*env)->DeleteLocalRef(env, jlocal);
}
/*
}
*/
}
}

View File

@ -136,7 +136,7 @@ static jobjectArray CreateJavaFilenameArray(JNIEnv *env, NSArray *filenameArray)
jclass stringClazz = (*env)->FindClass(env, "java/lang/String");
CHECK_NULL_RETURN(stringClazz, nil);
jobject jfilenameArray = (*env)->NewObjectArray(env, filenameCount, stringClazz, NULL);
if ((*env)->ExceptionOccurred(env)) {
if ((*env)->ExceptionCheck(env)) {
(*env)->ExceptionDescribe(env);
(*env)->ExceptionClear(env);
return nil;
@ -156,7 +156,7 @@ static jobjectArray CreateJavaFilenameArray(JNIEnv *env, NSArray *filenameArray)
// Create a Java String:
jstring string = (*env)->NewStringUTF(env, stringBytes);
if ((*env)->ExceptionOccurred(env)) {
if ((*env)->ExceptionCheck(env)) {
(*env)->ExceptionDescribe(env);
(*env)->ExceptionClear(env);
continue;
@ -168,7 +168,7 @@ static jobjectArray CreateJavaFilenameArray(JNIEnv *env, NSArray *filenameArray)
// Set the Java array element with our String:
(*env)->SetObjectArrayElement(env, jfilenameArray, i, string);
if ((*env)->ExceptionOccurred(env)) {
if ((*env)->ExceptionCheck(env)) {
(*env)->ExceptionDescribe(env);
(*env)->ExceptionClear(env);
continue;

View File

@ -371,10 +371,10 @@ extern jclass jc_CDropTargetContextPeer;
(*env)->ReleaseByteArrayElements(env, gbyteArray, jbytes, 0);
// In case of an error make sure to return nil:
if ((*env)->ExceptionOccurred(env)) {
(*env)->ExceptionDescribe(env);
if ((*env)->ExceptionCheck(env)) {
(*env)->ExceptionDescribe(env);
gbyteArray = nil;
}
}
return gbyteArray;
}

View File

@ -85,7 +85,7 @@ JNI_COCOA_ENTER(env);
GET_DTCP_CLASS_RETURN(result);
DECLARE_METHOD_RETURN(newDataMethod, jc_CDropTargetContextPeer, "newData", "(J[B)V", result);
if ((*env)->ExceptionOccurred(env) || !newDataMethod) {
if ((*env)->ExceptionCheck(env) || !newDataMethod) {
DLog2(@"[CDropTargetContextPeer startTransfer]: couldn't get newData method for %d.\n", (NSInteger) jdroptarget);
TransferFailed(env, jthis, jdroptarget, (jlong) 0L, jformat);
return result;

View File

@ -364,7 +364,7 @@ Java_sun_awt_CGraphicsDevice_nativeGetDisplayModes
if (cRef != NULL) {
jobject oneMode = createJavaDisplayMode(cRef, env);
(*env)->SetObjectArrayElement(env, jreturnArray, n, oneMode);
if ((*env)->ExceptionOccurred(env)) {
if ((*env)->ExceptionCheck(env)) {
(*env)->ExceptionDescribe(env);
(*env)->ExceptionClear(env);
continue;

View File

@ -316,10 +316,10 @@ JNI_COCOA_ENTER(env);
}
if ((*env)->CallBooleanMethod(env, returnValue, jm_listContains, localeObj) == JNI_FALSE) {
if ((*env)->ExceptionOccurred(env)) (*env)->ExceptionClear(env);
if ((*env)->ExceptionCheck(env)) (*env)->ExceptionClear(env);
(*env)->CallBooleanMethod(env, returnValue, jm_listAdd, localeObj);
}
if ((*env)->ExceptionOccurred(env)) (*env)->ExceptionClear(env);
if ((*env)->ExceptionCheck(env)) (*env)->ExceptionClear(env);
(*env)->DeleteLocalRef(env, localeObj);
}

View File

@ -577,7 +577,7 @@ JNI_COCOA_ENTER(env);
jstring jFontName = (jstring)NSStringToJavaString(env, fontname);
CFRelease(fontname);
(*env)->CallBooleanMethod(env, arrayListOfString, addMID, jFontName);
if ((*env)->ExceptionOccurred(env)) {
if ((*env)->ExceptionCheck(env)) {
CFRelease(fds);
return;
}

View File

@ -95,7 +95,7 @@ static CGAffineTransform sInverseTX = { 1, 0, 0, -1, 0, 0 };
_fontThrowJavaException = YES; \
goto cleanup; \
} \
if ((*env)->ExceptionCheck(env) == JNI_TRUE) { \
if ((*env)->ExceptionCheck(env)) { \
goto cleanup; \
}

View File

@ -154,7 +154,7 @@ MTLSD_SetNativeDimensions(JNIEnv *env, BMTLSDOps *mtlsdo,
}
JNU_SetFieldByName(env, NULL, sdObject, "nativeWidth", "I", width);
if (!((*env)->ExceptionOccurred(env))) {
if (!((*env)->ExceptionCheck(env))) {
JNU_SetFieldByName(env, NULL, sdObject, "nativeHeight", "I", height);
}

View File

@ -38,11 +38,11 @@
NSLog(@"Bad JNI lookup %s\n", name); \
NSLog(@"%@",[NSThread callStackSymbols]); \
if ([NSThread isMainThread] == NO) { \
if ((*env)->ExceptionOccurred(env) == NULL) { \
if (!(*env)->ExceptionCheck(env)) { \
JNU_ThrowInternalError(env, "Bad JNI Lookup"); \
} \
} else { \
if ((*env)->ExceptionOccurred(env) != NULL) { \
if ((*env)->ExceptionCheck(env)) { \
(*env)->ExceptionDescribe(env); \
} \
} \
@ -184,7 +184,7 @@
* nature of the problem that has been detected and how survivable it is.
*/
#define CHECK_EXCEPTION() \
if ((*env)->ExceptionOccurred(env) != NULL) { \
if ((*env)->ExceptionCheck(env)) { \
if ([NSThread isMainThread] == YES) { \
if (getenv("JNU_APPKIT_TRACE")) { \
(*env)->ExceptionDescribe(env); \

View File

@ -542,7 +542,7 @@ OGLSD_SetNativeDimensions(JNIEnv *env, OGLSDOps *oglsdo,
}
JNU_SetFieldByName(env, NULL, sdObject, "nativeWidth", "I", width);
if (!((*env)->ExceptionOccurred(env))) {
if (!((*env)->ExceptionCheck(env))) {
JNU_SetFieldByName(env, NULL, sdObject, "nativeHeight", "I", height);
}

View File

@ -984,7 +984,7 @@ int awt_getPixels(JNIEnv *env, RasterS_t *rasterP, void *bufferP) {
0, y, w,
maxLines, jdata, jdatabuffer);
if ((*env)->ExceptionOccurred(env)) {
if ((*env)->ExceptionCheck(env)) {
(*env)->DeleteLocalRef(env, jdata);
return -1;
}
@ -1104,7 +1104,7 @@ int awt_setPixels(JNIEnv *env, RasterS_t *rasterP, void *bufferP) {
0, y, w,
maxLines, jdata, jdatabuffer);
if ((*env)->ExceptionOccurred(env)) {
if ((*env)->ExceptionCheck(env)) {
(*env)->DeleteLocalRef(env, jdata);
return -1;
}

View File

@ -237,7 +237,7 @@ Java_sun_awt_image_GifImageDecoder_parseImage(JNIEnv *env,
len = (*env)->CallIntMethod(env, this, readID,
blockh, remain, blockLength + 1);
if (len > blockLength + 1) len = blockLength + 1;
if ((*env)->ExceptionOccurred(env)) {
if ((*env)->ExceptionCheck(env)) {
return 0;
}
GET_ARRAYS();
@ -314,10 +314,10 @@ Java_sun_awt_image_GifImageDecoder_parseImage(JNIEnv *env,
}
if ((*env)->CallIntMethod(env, this, readID,
blockh, 0, blockLength + 1) != 0
|| (*env)->ExceptionOccurred(env))
|| (*env)->ExceptionCheck(env))
{
/* quietly accept truncated GIF images */
return (!(*env)->ExceptionOccurred(env));
return (!(*env)->ExceptionCheck(env));
}
GET_ARRAYS();
blockLength = block[blockLength];
@ -412,7 +412,7 @@ Java_sun_awt_image_GifImageDecoder_parseImage(JNIEnv *env,
relx, rely + y,
width, passht,
raslineh, cmh);
if (count <= 0 || (*env)->ExceptionOccurred(env)) {
if (count <= 0 || (*env)->ExceptionCheck(env)) {
/* Nobody is listening any more. */
if (verbose) {
fprintf(stdout, "Orphan gif decoder quitting\n");

View File

@ -2017,7 +2017,7 @@ cvtCustomToDefault(JNIEnv *env, BufImageS_t *imageP, int component,
g_BImgGetRGBMID, 0, y,
w, numLines,
jpixels, 0, w);
if ((*env)->ExceptionOccurred(env)) {
if ((*env)->ExceptionCheck(env)) {
(*env)->DeleteLocalRef(env, jpixels);
return -1;
}
@ -2093,7 +2093,7 @@ cvtDefaultToCustom(JNIEnv *env, BufImageS_t *imageP, int component,
(*env)->CallVoidMethod(env, imageP->jimage, g_BImgSetRGBMID, 0, y,
w, numLines, jpixels,
0, w);
if ((*env)->ExceptionOccurred(env)) {
if ((*env)->ExceptionCheck(env)) {
(*env)->DeleteLocalRef(env, jpixels);
return -1;
}

View File

@ -118,7 +118,7 @@ GetSDOps(JNIEnv *env, jobject sData, jboolean callSetup)
}
ops = (SurfaceDataOps *)JNU_GetLongFieldAsPtr(env, sData, pDataID);
if (ops == NULL) {
if (!(*env)->ExceptionOccurred(env) &&
if (!(*env)->ExceptionCheck(env) &&
!(*env)->IsInstanceOf(env, sData, pNullSurfaceDataClass))
{
if (!(*env)->GetBooleanField(env, sData, validID)) {

View File

@ -50,7 +50,7 @@ hb_jdk_get_nominal_glyph (hb_font_t *font HB_UNUSED,
jobject font2D = jdkFontInfo->font2D;
*glyph = (hb_codepoint_t)env->CallIntMethod(
font2D, sunFontIDs.f2dCharToGlyphMID, unicode);
if (env->ExceptionOccurred())
if (env->ExceptionCheck())
{
env->ExceptionClear();
}
@ -75,7 +75,7 @@ hb_jdk_get_variation_glyph (hb_font_t *font HB_UNUSED,
*glyph = (hb_codepoint_t)env->CallIntMethod(
font2D, sunFontIDs.f2dCharToVariationGlyphMID,
unicode, variation_selector);
if (env->ExceptionOccurred())
if (env->ExceptionCheck())
{
env->ExceptionClear();
}

View File

@ -575,7 +575,7 @@ sun_jpeg_output_message (j_common_ptr cinfo)
(*env)->CallVoidMethod(env, theObject,
JPEGImageReader_warningWithMessageID,
string);
if ((*env)->ExceptionOccurred(env)
if ((*env)->ExceptionCheck(env)
|| !GET_ARRAYS(env, data, &(src->next_input_byte))) {
cinfo->err->error_exit(cinfo);
}
@ -585,7 +585,7 @@ sun_jpeg_output_message (j_common_ptr cinfo)
(*env)->CallVoidMethod(env, theObject,
JPEGImageWriter_warningWithMessageID,
string);
if ((*env)->ExceptionOccurred(env)
if ((*env)->ExceptionCheck(env)
|| !GET_ARRAYS(env, data,
(const JOCTET **)(&dest->next_output_byte))) {
cinfo->err->error_exit(cinfo);
@ -625,7 +625,7 @@ static void imageio_set_stream(JNIEnv *env,
if (setjmp(jerr->setjmp_buffer)) {
/* If we get here, the JPEG code has signaled an error
while aborting. */
if (!(*env)->ExceptionOccurred(env)) {
if (!(*env)->ExceptionCheck(env)) {
char buffer[JMSG_LENGTH_MAX];
(*cinfo->err->format_message) (cinfo,
buffer);
@ -651,7 +651,7 @@ static void imageio_reset(JNIEnv *env,
if (setjmp(jerr->setjmp_buffer)) {
/* If we get here, the JPEG code has signaled an error
while aborting. */
if (!(*env)->ExceptionOccurred(env)) {
if (!(*env)->ExceptionCheck(env)) {
char buffer[JMSG_LENGTH_MAX];
(*cinfo->err->format_message) (cinfo, buffer);
JNU_ThrowByName(env, "javax/imageio/IIOException", buffer);
@ -969,7 +969,7 @@ imageio_fill_input_buffer(j_decompress_ptr cinfo)
if ((ret > 0) && ((unsigned int)ret > sb->bufferLength)) {
ret = (int)sb->bufferLength;
}
if ((*env)->ExceptionOccurred(env)
if ((*env)->ExceptionCheck(env)
|| !GET_ARRAYS(env, data, &(src->next_input_byte))) {
cinfo->err->error_exit((j_common_ptr) cinfo);
}
@ -992,7 +992,7 @@ imageio_fill_input_buffer(j_decompress_ptr cinfo)
(*env)->CallVoidMethod(env, reader,
JPEGImageReader_warningOccurredID,
READ_NO_EOI);
if ((*env)->ExceptionOccurred(env)
if ((*env)->ExceptionCheck(env)
|| !GET_ARRAYS(env, data, &(src->next_input_byte))) {
cinfo->err->error_exit((j_common_ptr) cinfo);
}
@ -1067,7 +1067,7 @@ imageio_fill_suspended_buffer(j_decompress_ptr cinfo)
sb->hstreamBuffer,
offset, buflen);
if ((ret > 0) && ((unsigned int)ret > buflen)) ret = (int)buflen;
if ((*env)->ExceptionOccurred(env)
if ((*env)->ExceptionCheck(env)
|| !GET_ARRAYS(env, data, &(src->next_input_byte))) {
cinfo->err->error_exit((j_common_ptr) cinfo);
}
@ -1083,7 +1083,7 @@ imageio_fill_suspended_buffer(j_decompress_ptr cinfo)
(*env)->CallVoidMethod(env, reader,
JPEGImageReader_warningOccurredID,
READ_NO_EOI);
if ((*env)->ExceptionOccurred(env)
if ((*env)->ExceptionCheck(env)
|| !GET_ARRAYS(env, data, &(src->next_input_byte))) {
cinfo->err->error_exit((j_common_ptr) cinfo);
}
@ -1168,7 +1168,7 @@ imageio_skip_input_data(j_decompress_ptr cinfo, long num_bytes)
input,
JPEGImageReader_skipInputBytesID,
(jlong) num_bytes);
if ((*env)->ExceptionOccurred(env)
if ((*env)->ExceptionCheck(env)
|| !GET_ARRAYS(env, data, &(src->next_input_byte))) {
cinfo->err->error_exit((j_common_ptr) cinfo);
}
@ -1187,7 +1187,7 @@ imageio_skip_input_data(j_decompress_ptr cinfo, long num_bytes)
JPEGImageReader_warningOccurredID,
READ_NO_EOI);
if ((*env)->ExceptionOccurred(env)
if ((*env)->ExceptionCheck(env)
|| !GET_ARRAYS(env, data, &(src->next_input_byte))) {
cinfo->err->error_exit((j_common_ptr) cinfo);
}
@ -1221,7 +1221,7 @@ imageio_term_source(j_decompress_ptr cinfo)
JPEGImageReader_pushBackID,
src->bytes_in_buffer);
if ((*env)->ExceptionOccurred(env)
if ((*env)->ExceptionCheck(env)
|| !GET_ARRAYS(env, data, &(src->next_input_byte))) {
cinfo->err->error_exit((j_common_ptr) cinfo);
}
@ -1660,7 +1660,7 @@ Java_com_sun_imageio_plugins_jpeg_JPEGImageReader_readImageHeader
/* If we get here, the JPEG code has signaled an error
while reading the header. */
RELEASE_ARRAYS(env, data, src->next_input_byte);
if (!(*env)->ExceptionOccurred(env)) {
if (!(*env)->ExceptionCheck(env)) {
char buffer[JMSG_LENGTH_MAX];
(*cinfo->err->format_message) ((struct jpeg_common_struct *) cinfo,
buffer);
@ -1819,7 +1819,7 @@ Java_com_sun_imageio_plugins_jpeg_JPEGImageReader_readImageHeader
cinfo->out_color_space,
cinfo->num_components,
profileData);
if ((*env)->ExceptionOccurred(env)
if ((*env)->ExceptionCheck(env)
|| !GET_ARRAYS(env, data, &(src->next_input_byte))) {
cinfo->err->error_exit((j_common_ptr) cinfo);
}
@ -1988,7 +1988,7 @@ Java_com_sun_imageio_plugins_jpeg_JPEGImageReader_readImage
/* If we get here, the JPEG code has signaled an error
while reading. */
RELEASE_ARRAYS(env, data, src->next_input_byte);
if (!(*env)->ExceptionOccurred(env)) {
if (!(*env)->ExceptionCheck(env)) {
char buffer[JMSG_LENGTH_MAX];
(*cinfo->err->format_message) ((struct jpeg_common_struct *) cinfo,
buffer);
@ -2074,7 +2074,7 @@ Java_com_sun_imageio_plugins_jpeg_JPEGImageReader_readImage
(*env)->CallVoidMethod(env, this,
JPEGImageReader_passStartedID,
cinfo->input_scan_number-1);
if ((*env)->ExceptionOccurred(env)
if ((*env)->ExceptionCheck(env)
|| !GET_ARRAYS(env, data, &(src->next_input_byte))) {
cinfo->err->error_exit((j_common_ptr) cinfo);
}
@ -2084,7 +2084,7 @@ Java_com_sun_imageio_plugins_jpeg_JPEGImageReader_readImage
(*env)->CallVoidMethod(env, this,
JPEGImageReader_passStartedID,
0);
if ((*env)->ExceptionOccurred(env)
if ((*env)->ExceptionCheck(env)
|| !GET_ARRAYS(env, data, &(src->next_input_byte))) {
cinfo->err->error_exit((j_common_ptr) cinfo);
}
@ -2144,7 +2144,7 @@ Java_com_sun_imageio_plugins_jpeg_JPEGImageReader_readImage
targetLine++,
progressive);
if ((*env)->ExceptionOccurred(env)
if ((*env)->ExceptionCheck(env)
|| !GET_ARRAYS(env, data, &(src->next_input_byte))) {
cinfo->err->error_exit((j_common_ptr) cinfo);
}
@ -2178,7 +2178,7 @@ Java_com_sun_imageio_plugins_jpeg_JPEGImageReader_readImage
RELEASE_ARRAYS(env, data, src->next_input_byte);
(*env)->CallVoidMethod(env, this,
JPEGImageReader_passCompleteID);
if ((*env)->ExceptionOccurred(env)
if ((*env)->ExceptionCheck(env)
|| !GET_ARRAYS(env, data, &(src->next_input_byte))) {
cinfo->err->error_exit((j_common_ptr) cinfo);
}
@ -2336,7 +2336,7 @@ Java_com_sun_imageio_plugins_jpeg_JPEGImageReader_resetReader
become more flexible.
*/
if ((*env)->ExceptionOccurred(env)) {
if ((*env)->ExceptionCheck(env)) {
(*env)->ExceptionClear(env);
}
} else {
@ -2415,7 +2415,7 @@ imageio_empty_output_buffer (j_compress_ptr cinfo)
sb->hstreamBuffer,
0,
sb->bufferLength);
if ((*env)->ExceptionOccurred(env)
if ((*env)->ExceptionCheck(env)
|| !GET_ARRAYS(env, data,
(const JOCTET **)(&dest->next_output_byte))) {
cinfo->err->error_exit((j_common_ptr) cinfo);
@ -2458,7 +2458,7 @@ imageio_term_destination (j_compress_ptr cinfo)
0,
datacount);
if ((*env)->ExceptionOccurred(env)
if ((*env)->ExceptionCheck(env)
|| !GET_ARRAYS(env, data,
(const JOCTET **)(&dest->next_output_byte))) {
cinfo->err->error_exit((j_common_ptr) cinfo);
@ -2669,7 +2669,7 @@ Java_com_sun_imageio_plugins_jpeg_JPEGImageWriter_writeTables
/* If we get here, the JPEG code has signaled an error
while writing. */
RELEASE_ARRAYS(env, data, (const JOCTET *)(dest->next_output_byte));
if (!(*env)->ExceptionOccurred(env)) {
if (!(*env)->ExceptionCheck(env)) {
char buffer[JMSG_LENGTH_MAX];
(*cinfo->err->format_message) ((j_common_ptr) cinfo,
buffer);
@ -2892,7 +2892,7 @@ Java_com_sun_imageio_plugins_jpeg_JPEGImageWriter_writeImage
/* If we get here, the JPEG code has signaled an error
while writing. */
RELEASE_ARRAYS(env, data, (const JOCTET *)(dest->next_output_byte));
if (!(*env)->ExceptionOccurred(env)) {
if (!(*env)->ExceptionCheck(env)) {
char buffer[JMSG_LENGTH_MAX];
(*cinfo->err->format_message) ((j_common_ptr) cinfo,
buffer);
@ -3039,7 +3039,7 @@ Java_com_sun_imageio_plugins_jpeg_JPEGImageWriter_writeImage
(*env)->CallVoidMethod(env,
this,
JPEGImageWriter_writeMetadataID);
if ((*env)->ExceptionOccurred(env)
if ((*env)->ExceptionCheck(env)
|| !GET_ARRAYS(env, data,
(const JOCTET **)(&dest->next_output_byte))) {
cinfo->err->error_exit((j_common_ptr) cinfo);
@ -3059,7 +3059,7 @@ Java_com_sun_imageio_plugins_jpeg_JPEGImageWriter_writeImage
this,
JPEGImageWriter_grabPixelsID,
targetLine);
if ((*env)->ExceptionOccurred(env)
if ((*env)->ExceptionCheck(env)
|| !GET_ARRAYS(env, data,
(const JOCTET **)(&dest->next_output_byte))) {
cinfo->err->error_exit((j_common_ptr) cinfo);

View File

@ -298,7 +298,7 @@ sun_jpeg_fill_input_buffer(j_decompress_ptr cinfo)
ret = (*env)->CallIntMethod(env, src->hInputStream, InputStream_readID,
src->hInputBuffer, 0, buflen);
if (ret > buflen) ret = buflen;
if ((*env)->ExceptionOccurred(env) || !GET_ARRAYS(env, src)) {
if ((*env)->ExceptionCheck(env) || !GET_ARRAYS(env, src)) {
cinfo->err->error_exit((struct jpeg_common_struct *) cinfo);
}
if (ret <= 0) {
@ -334,7 +334,7 @@ sun_jpeg_fill_suspended_buffer(j_decompress_ptr cinfo)
RELEASE_ARRAYS(env, src);
ret = (*env)->CallIntMethod(env, src->hInputStream,
InputStream_availableID);
if ((*env)->ExceptionOccurred(env) || !GET_ARRAYS(env, src)) {
if ((*env)->ExceptionCheck(env) || !GET_ARRAYS(env, src)) {
cinfo->err->error_exit((struct jpeg_common_struct *) cinfo);
}
if (ret < 0 || (unsigned int)ret <= src->remaining_skip) {
@ -359,7 +359,7 @@ sun_jpeg_fill_suspended_buffer(j_decompress_ptr cinfo)
ret = (*env)->CallIntMethod(env, src->hInputStream, InputStream_readID,
src->hInputBuffer, offset, buflen);
if ((ret > 0) && ((unsigned int)ret > buflen)) ret = (int)buflen;
if ((*env)->ExceptionOccurred(env) || !GET_ARRAYS(env, src)) {
if ((*env)->ExceptionCheck(env) || !GET_ARRAYS(env, src)) {
cinfo->err->error_exit((struct jpeg_common_struct *) cinfo);
}
if (ret <= 0) {
@ -439,7 +439,7 @@ sun_jpeg_skip_input_data(j_decompress_ptr cinfo, long num_bytes)
InputStream_readID,
src->hInputBuffer, 0, buflen);
if (ret > buflen) ret = buflen;
if ((*env)->ExceptionOccurred(env)) {
if ((*env)->ExceptionCheck(env)) {
cinfo->err->error_exit((struct jpeg_common_struct *) cinfo);
}
if (ret < 0) {
@ -538,7 +538,7 @@ Java_sun_awt_image_JPEGImageDecoder_readImage(JNIEnv *env,
*/
jpeg_destroy_decompress(&cinfo);
RELEASE_ARRAYS(env, &jsrc);
if (!(*env)->ExceptionOccurred(env)) {
if (!(*env)->ExceptionCheck(env)) {
char buffer[JMSG_LENGTH_MAX];
(*cinfo.err->format_message) ((struct jpeg_common_struct *) &cinfo,
buffer);
@ -584,7 +584,7 @@ Java_sun_awt_image_JPEGImageDecoder_readImage(JNIEnv *env,
ret = (*env)->CallBooleanMethod(env, this, sendHeaderInfoID,
cinfo.image_width, cinfo.image_height,
grayscale, hasalpha, buffered_mode);
if ((*env)->ExceptionOccurred(env) || !ret) {
if ((*env)->ExceptionCheck(env) || !ret) {
/* No more interest in this image... */
jpeg_destroy_decompress(&cinfo);
return;
@ -694,7 +694,7 @@ Java_sun_awt_image_JPEGImageDecoder_readImage(JNIEnv *env,
jsrc.hOutputBuffer,
cinfo.output_scanline - 1);
}
if ((*env)->ExceptionOccurred(env) || !ret ||
if ((*env)->ExceptionCheck(env) || !ret ||
!GET_ARRAYS(env, &jsrc)) {
/* No more interest in this image... */
jpeg_destroy_decompress(&cinfo);

View File

@ -209,7 +209,7 @@ void* PORT_NewBooleanControl(void* creatorV, void* controlID, char* type) {
if (!ctrl) {
ERROR0("PORT_NewBooleanControl: ctrl is NULL\n");
}
if ((*creator->env)->ExceptionOccurred(creator->env)) {
if ((*creator->env)->ExceptionCheck(creator->env)) {
ERROR0("PORT_NewBooleanControl: ExceptionOccurred!\n");
}
TRACE0("PORT_NewBooleanControl succeeded\n");
@ -264,7 +264,7 @@ void* PORT_NewCompoundControl(void* creatorV, char* type, void** controls, int c
if (!ctrl) {
ERROR0("PORT_NewCompoundControl: ctrl is NULL\n");
}
if ((*creator->env)->ExceptionOccurred(creator->env)) {
if ((*creator->env)->ExceptionCheck(creator->env)) {
ERROR0("PORT_NewCompoundControl: ExceptionOccurred!\n");
}
TRACE0("PORT_NewCompoundControl succeeded\n");
@ -327,7 +327,7 @@ void* PORT_NewFloatControl(void* creatorV, void* controlID, char* type,
if (!ctrl) {
ERROR0("PORT_NewFloatControl: ctrl is NULL!\n");
}
if ((*creator->env)->ExceptionOccurred(creator->env)) {
if ((*creator->env)->ExceptionCheck(creator->env)) {
ERROR0("PORT_NewFloatControl: ExceptionOccurred!\n");
}
TRACE1("PORT_NewFloatControl succeeded %p\n", (void*) ctrl);
@ -339,7 +339,7 @@ int PORT_AddControl(void* creatorV, void* control) {
TRACE1("PORT_AddControl %p\n", (void*) control);
(*creator->env)->CallVoidMethod(creator->env, creator->vector, creator->vectorAddElement, (jobject) control);
if ((*creator->env)->ExceptionOccurred(creator->env)) {
if ((*creator->env)->ExceptionCheck(creator->env)) {
ERROR0("PORT_AddControl: ExceptionOccurred!\n");
}
TRACE0("PORT_AddControl succeeded\n");

View File

@ -122,7 +122,7 @@ Java_java_awt_SplashScreen__1getBounds(JNIEnv * env, jclass thisClass,
if (clazz && mid) {
bounds = (*env)->NewObject(env, clazz, mid, splash->x, splash->y,
splash->width, splash->height);
if ((*env)->ExceptionOccurred(env)) {
if ((*env)->ExceptionCheck(env)) {
bounds = NULL;
(*env)->ExceptionDescribe(env);
(*env)->ExceptionClear(env);

View File

@ -1287,7 +1287,7 @@ Java_sun_awt_X11GraphicsDevice_pGetBounds(JNIEnv *env, jobject this, jint screen
xwa.width, xwa.height);
}
if ((*env)->ExceptionOccurred(env)) {
if ((*env)->ExceptionCheck(env)) {
return NULL;
}
}

View File

@ -1328,7 +1328,7 @@ static void DestroyXIMCallback(XIM im, XPointer client_data, XPointer call_data)
x11InputMethodGRefListHead->inputMethodGRef) == NULL) {
/* Clear possible exceptions
*/
if ((*env)->ExceptionOccurred(env)) {
if ((*env)->ExceptionCheck(env)) {
(*env)->ExceptionDescribe(env);
(*env)->ExceptionClear(env);
}

View File

@ -96,7 +96,7 @@ awtJNI_ThreadYield(JNIEnv *env) {
} /* threadClass == NULL*/
(*env)->CallStaticVoidMethod(env, threadClass, yieldMethodID);
DASSERT(!((*env)->ExceptionOccurred(env)));
DASSERT(!((*env)->ExceptionCheck(env)));
if ((*env)->ExceptionCheck(env)) {
return JNI_FALSE;
}

View File

@ -85,7 +85,7 @@ static gboolean filenameFilterCallback(const GtkFileFilterInfo * filter_info, gp
static void quit(JNIEnv * env, jobject jpeer, gboolean isSignalHandler)
{
jthrowable pendingException;
if (pendingException = (*env)->ExceptionOccurred(env)) {
if ((pendingException = (*env)->ExceptionOccurred(env)) != NULL) {
(*env)->ExceptionClear(env);
}

View File

@ -62,7 +62,7 @@ void D3DSD_SetNativeDimensions(JNIEnv *env, D3DSDOps *d3dsdo) {
}
JNU_SetFieldByName(env, NULL, sdObject, "nativeWidth", "I", width);
if (!(env->ExceptionOccurred())) {
if (!(env->ExceptionCheck())) {
JNU_SetFieldByName(env, NULL, sdObject, "nativeHeight", "I", height);
}

View File

@ -372,7 +372,7 @@ Java_sun_java2d_windows_GDIWindowSurfaceData_initOps(JNIEnv *env, jobject wsd,
wsdo->invalid = JNI_FALSE;
wsdo->lockType = WIN32SD_LOCK_UNLOCKED;
wsdo->peer = env->NewWeakGlobalRef(peer);
if (env->ExceptionOccurred()) {
if (env->ExceptionCheck()) {
return;
}
wsdo->depth = depth;