提交 3d417773 编写于 作者: P pchelko

8036793: [parfait] JNI exception pending in jdk/src/windows/native/sun/windows/awt_new.cpp

Reviewed-by: anthony, serb, azvegint
上级 cab11ae3
......@@ -163,18 +163,13 @@ jthrowable
safe_ExceptionOccurred(JNIEnv *env) throw (std::bad_alloc) {
jthrowable xcp = env->ExceptionOccurred();
if (xcp != NULL) {
env->ExceptionClear(); // if we don't do this, FindClass will fail
jclass outofmem = env->FindClass("java/lang/OutOfMemoryError");
DASSERT(outofmem != NULL);
jboolean isOutofmem = env->IsInstanceOf(xcp, outofmem);
env->DeleteLocalRef(outofmem);
if (isOutofmem) {
env->ExceptionClear(); // if we don't do this, isInstanceOf will fail
jint isOutofmem = JNU_IsInstanceOfByName(env, xcp, "java/lang/OutOfMemoryError");
if (isOutofmem > 0) {
env->DeleteLocalRef(xcp);
throw std::bad_alloc();
} else {
env->ExceptionClear();
// rethrow exception
env->Throw(xcp);
return xcp;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册