< 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,21 +337,24 @@
 static jthread newThreadObj(JNIEnv* jni) {
     jclass thrClass;
     jmethodID cid;
     jthread result = NULL;
 
-    if (!NSK_JNI_VERIFY(jni, (thrClass = jni->FindClass("java/lang/Thread")) != NULL )) {
+    thrClass = jni->FindClass("java/lang/Thread");
+    if (!NSK_JNI_VERIFY(jni, thrClass != NULL)) {
         nsk_jvmti_setFailStatus();
         return result;
     }
 
-    if (!NSK_JNI_VERIFY(jni, (cid = jni->GetMethodID(thrClass, "<init>", "()V")) != NULL )) {
+    cid = jni->GetMethodID(thrClass, "<init>", "()V");
+    if (!NSK_JNI_VERIFY(jni, cid != NULL)) {
         nsk_jvmti_setFailStatus();
         return result;
     }
 
-    if (!NSK_JNI_VERIFY(jni, (result = jni->NewObject(thrClass, cid)) != NULL )) {
+    result = jni->NewObject(thrClass, cid);
+    if (!NSK_JNI_VERIFY(jni, result != NULL)) {
         nsk_jvmti_setFailStatus();
         return result;
     }
 
     return result;

@@ -364,11 +367,12 @@
     jthread threadObj = NULL;
 
     setCounter(&iterationCount, 0);
     setCounter(&objectCount, 0);
 
-    if (!NSK_VERIFY((threadObj = newThreadObj(jni)) != NULL)) {
+    threadObj = newThreadObj(jni);
+    if (!NSK_VERIFY(threadObj != NULL)) {
         nsk_jvmti_setFailStatus();
         return NSK_FALSE;
     }
 
     /* enter endLock */

@@ -509,12 +513,12 @@
                                                                                             jclass  klass ) {
     jobject root = NULL;
     int modified = 0;
     int found = 0;
 
-    if (!NSK_JNI_VERIFY(jni, (root =
-            jni->GetStaticObjectField(debugeeClass, rootFieldID)) != NULL )) {
+    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,16 +558,17 @@
     if (debugeeClass == NULL) {
         nsk_jvmti_setFailStatus();
         return;
     }
 
-    if (!NSK_JNI_VERIFY(jni, (debugeeClass = (jclass)jni->NewGlobalRef(debugeeClass)) != NULL))
+    debugeeClass = (jclass) jni->NewGlobalRef(debugeeClass);
+    if (!NSK_JNI_VERIFY(jni, 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 )) {
+    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,12 +605,12 @@
     /* 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))
+    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 >