< prev index next >

test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/allocation/AP04/ap04t003/ap04t003.cpp

Print this page
rev 52233 : 8212884: Remove the assignments in ifs for vmTestbase/[a-s]
Summary:
Reviewed-by:

*** 337,357 **** static jthread newThreadObj(JNIEnv* jni) { jclass thrClass; jmethodID cid; jthread result = NULL; ! if (!NSK_JNI_VERIFY(jni, (thrClass = jni->FindClass("java/lang/Thread")) != NULL )) { nsk_jvmti_setFailStatus(); return result; } ! if (!NSK_JNI_VERIFY(jni, (cid = jni->GetMethodID(thrClass, "<init>", "()V")) != NULL )) { nsk_jvmti_setFailStatus(); return result; } ! if (!NSK_JNI_VERIFY(jni, (result = jni->NewObject(thrClass, cid)) != NULL )) { nsk_jvmti_setFailStatus(); return result; } return result; --- 337,360 ---- static jthread newThreadObj(JNIEnv* jni) { jclass thrClass; jmethodID cid; jthread result = NULL; ! thrClass = jni->FindClass("java/lang/Thread"); ! if (!NSK_JNI_VERIFY(jni, thrClass != NULL)) { nsk_jvmti_setFailStatus(); return result; } ! cid = jni->GetMethodID(thrClass, "<init>", "()V"); ! if (!NSK_JNI_VERIFY(jni, cid != NULL)) { nsk_jvmti_setFailStatus(); return result; } ! result = jni->NewObject(thrClass, cid); ! if (!NSK_JNI_VERIFY(jni, result != NULL)) { nsk_jvmti_setFailStatus(); return result; } return result;
*** 364,374 **** jthread threadObj = NULL; setCounter(&iterationCount, 0); setCounter(&objectCount, 0); ! if (!NSK_VERIFY((threadObj = newThreadObj(jni)) != NULL)) { nsk_jvmti_setFailStatus(); return NSK_FALSE; } /* enter endLock */ --- 367,378 ---- jthread threadObj = NULL; setCounter(&iterationCount, 0); setCounter(&objectCount, 0); ! threadObj = newThreadObj(jni); ! if (!NSK_VERIFY(threadObj != NULL)) { nsk_jvmti_setFailStatus(); return NSK_FALSE; } /* enter endLock */
*** 509,520 **** jclass klass ) { jobject root = NULL; int modified = 0; int found = 0; ! if (!NSK_JNI_VERIFY(jni, (root = ! jni->GetStaticObjectField(debugeeClass, rootFieldID)) != NULL )) { NSK_COMPLAIN0("GetStaticObjectField returned NULL for 'root' field value\n\n"); nsk_jvmti_setFailStatus(); return; } --- 513,524 ---- jclass klass ) { jobject root = NULL; int modified = 0; int found = 0; ! root = jni->GetStaticObjectField(debugeeClass, rootFieldID); ! if (!NSK_JNI_VERIFY(jni, root != NULL)) { NSK_COMPLAIN0("GetStaticObjectField returned NULL for 'root' field value\n\n"); nsk_jvmti_setFailStatus(); return; }
*** 554,569 **** if (debugeeClass == NULL) { nsk_jvmti_setFailStatus(); return; } ! if (!NSK_JNI_VERIFY(jni, (debugeeClass = (jclass)jni->NewGlobalRef(debugeeClass)) != NULL)) return; NSK_DISPLAY1("Find ID of 'root' field: %s\n", ROOT_SIGNATURE); ! if (!NSK_JNI_VERIFY(jni, (rootFieldID = ! jni->GetStaticFieldID(debugeeClass, "root", ROOT_SIGNATURE)) != NULL )) { nsk_jvmti_setFailStatus(); return; } NSK_DISPLAY0("Let debugee to run test cases\n"); --- 558,574 ---- if (debugeeClass == NULL) { nsk_jvmti_setFailStatus(); return; } ! debugeeClass = (jclass) jni->NewGlobalRef(debugeeClass); ! if (!NSK_JNI_VERIFY(jni, debugeeClass != NULL)) return; NSK_DISPLAY1("Find ID of 'root' field: %s\n", ROOT_SIGNATURE); ! rootFieldID = jni->GetStaticFieldID(debugeeClass, "root", ROOT_SIGNATURE); ! if (!NSK_JNI_VERIFY(jni, rootFieldID != NULL)) { nsk_jvmti_setFailStatus(); return; } NSK_DISPLAY0("Let debugee to run test cases\n");
*** 600,611 **** /* init framework and parse options */ if (!NSK_VERIFY(nsk_jvmti_parseOptions(options))) return JNI_ERR; /* create JVMTI environment */ ! if (!NSK_VERIFY((jvmti = ! nsk_jvmti_createJVMTIEnv(jvm, reserved)) != NULL)) return JNI_ERR; if (!NSK_JVMTI_VERIFY(jvmti->CreateRawMonitor("counterMonitor", &counterMonitor_ptr))) { return JNI_ERR; } --- 605,616 ---- /* init framework and parse options */ if (!NSK_VERIFY(nsk_jvmti_parseOptions(options))) return JNI_ERR; /* create JVMTI environment */ ! jvmti = nsk_jvmti_createJVMTIEnv(jvm, reserved); ! if (!NSK_VERIFY(jvmti != NULL)) return JNI_ERR; if (!NSK_JVMTI_VERIFY(jvmti->CreateRawMonitor("counterMonitor", &counterMonitor_ptr))) { return JNI_ERR; }
< prev index next >