8031583: warnings from b03 for hotspot/agent/src/os/solaris/proc: JNI exception pending

Added missed exception checks

Reviewed-by: sla, sspitsyn
This commit is contained in:
Dmitry Samersoff 2014-08-28 06:32:16 -07:00
parent cd4f6c4f45
commit ca7943ac3b

@ -90,7 +90,9 @@ struct DebuggerWith2Objects : DebuggerWithObject {
*/
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);
}
// JNI ids for some fields, methods
@ -962,6 +964,7 @@ JNIEXPORT jlongArray JNICALL Java_sun_jvm_hotspot_debugger_proc_ProcDebuggerLoca
CHECK_EXCEPTION_(0);
jboolean isCopy;
jlong* ptr = env->GetLongArrayElements(res, &isCopy);
CHECK_EXCEPTION_(NULL);
for (int i = 0; i < NPRGREG; i++) {
ptr[i] = (jlong) (uintptr_t) gregs[i];
}
@ -1253,6 +1256,7 @@ JNIEXPORT jstring JNICALL Java_sun_jvm_hotspot_debugger_proc_ProcDebuggerLocal_d
(JNIEnv *env, jobject this_object, jstring name) {
jboolean isCopy;
const char* ptr = env->GetStringUTFChars(name, &isCopy);
CHECK_EXCEPTION_(NULL);
char buf[2*SYMBOL_BUF_SIZE + 1];
jstring res = 0;
if (cplus_demangle((char*) ptr, buf, sizeof(buf)) != DEMANGLE_ESPACE) {
@ -1439,7 +1443,9 @@ JNIEXPORT void JNICALL Java_sun_jvm_hotspot_debugger_proc_ProcDebuggerLocal_init
"createClosestSymbol", "(Ljava/lang/String;J)Lsun/jvm/hotspot/debugger/cdbg/ClosestSymbol;");
CHECK_EXCEPTION;
listAdd_ID = env->GetMethodID(env->FindClass("java/util/List"), "add", "(Ljava/lang/Object;)Z");
jclass list_clazz = env->FindClass("java/util/List");
CHECK_EXCEPTION;
listAdd_ID = env->GetMethodID(list_clazz, "add", "(Ljava/lang/Object;)Z");
CHECK_EXCEPTION;
// part of the class sharing workaround