8035419: warning from b09 for hotspot.agent.src.os.win32.windbg.sawindbg.cpp: 'JNI exception pending'
authordsamersoff
Thu, 04 Sep 2014 04:17:32 -0700
changeset 26560 ec2ebd701956
parent 26559 5bd1fc767a88
child 26562 c2e144c5b6a2
8035419: warning from b09 for hotspot.agent.src.os.win32.windbg.sawindbg.cpp: 'JNI exception pending' Summary: added missed exceptions checks Reviewed-by: sla, sspitsyn
hotspot/agent/src/os/win32/windbg/sawindbg.cpp
--- a/hotspot/agent/src/os/win32/windbg/sawindbg.cpp	Thu Sep 04 08:48:53 2014 +0200
+++ b/hotspot/agent/src/os/win32/windbg/sawindbg.cpp	Thu Sep 04 04:17:32 2014 -0700
@@ -112,7 +112,9 @@
  return;}
 
 static void throwNewDebuggerException(JNIEnv* env, const char* errMsg) {
-  env->ThrowNew(env->FindClass("sun/jvm/hotspot/debugger/DebuggerException"), errMsg);
+  jclass clazz = env->FindClass("sun/jvm/hotspot/debugger/DebuggerException");
+  CHECK_EXCEPTION;
+  env->ThrowNew(clazz, errMsg);
 }
 
 /*
@@ -310,15 +312,18 @@
 static bool setImageAndSymbolPath(JNIEnv* env, jobject obj) {
   jboolean isCopy;
   jclass clazz = env->GetObjectClass(obj);
+  CHECK_EXCEPTION_(false);
   jstring path;
   const char* buf;
 
   path = (jstring) env->GetStaticObjectField(clazz, imagePath_ID);
+  CHECK_EXCEPTION_(false);
   buf = env->GetStringUTFChars(path, &isCopy);
   CHECK_EXCEPTION_(false);
   AutoJavaString imagePath(env, path, buf);
 
   path = (jstring) env->GetStaticObjectField(clazz, symbolPath_ID);
+  CHECK_EXCEPTION_(false);
   buf = env->GetStringUTFChars(path, &isCopy);
   CHECK_EXCEPTION_(false);
   AutoJavaString symbolPath(env, path, buf);