comparison test/hotspot/jtreg/vmTestbase/nsk/jvmti/GetOwnedMonitorInfo/ownmoninf001/ownmoninf001.cpp @ 53610:9cfc8b0c45fd

8214149: Move out assignments when not using NSK*VERIFY macros Summary: Move out the assignments from ifs Reviewed-by: sspitsyn, cjplummer
author jcbeyler
date Wed, 21 Nov 2018 10:46:45 -0800
parents b613bf6a10b1
children
comparison
equal deleted inserted replaced
1:c5e3d67a3222 2:25ca049226b8
120 120
121 JNIEXPORT void JNICALL 121 JNIEXPORT void JNICALL
122 Java_nsk_jvmti_GetOwnedMonitorInfo_ownmoninf001_checkMon1(JNIEnv *env, 122 Java_nsk_jvmti_GetOwnedMonitorInfo_ownmoninf001_checkMon1(JNIEnv *env,
123 jclass cls, jint point, jthread thr, jobject lock) { 123 jclass cls, jint point, jthread thr, jobject lock) {
124 jobject *monitors; 124 jobject *monitors;
125 if ((monitors = getInfo(env, point, thr, 1)) == NULL) { 125 monitors = getInfo(env, point, thr, 1);
126 if (monitors == NULL) {
126 return; 127 return;
127 } 128 }
128 if (!env->IsSameObject(lock, monitors[0])) { 129 if (!env->IsSameObject(lock, monitors[0])) {
129 result = STATUS_FAILED; 130 result = STATUS_FAILED;
130 printf("Point %d: not expected monitor: 0x%p\n", point, monitors[0]); 131 printf("Point %d: not expected monitor: 0x%p\n", point, monitors[0]);
133 134
134 JNIEXPORT void JNICALL 135 JNIEXPORT void JNICALL
135 Java_nsk_jvmti_GetOwnedMonitorInfo_ownmoninf001_checkMon2(JNIEnv *env, 136 Java_nsk_jvmti_GetOwnedMonitorInfo_ownmoninf001_checkMon2(JNIEnv *env,
136 jclass cls, jint point, jthread thr, jobject lock1, jobject lock2) { 137 jclass cls, jint point, jthread thr, jobject lock1, jobject lock2) {
137 jobject *monitors; 138 jobject *monitors;
138 if ((monitors = getInfo(env, point, thr, 2)) == NULL) { 139 monitors = getInfo(env, point, thr, 2);
140 if (monitors == NULL) {
139 return; 141 return;
140 } 142 }
141 if (!env->IsSameObject(lock1, monitors[0]) && !env->IsSameObject(lock2, monitors[0])) { 143 if (!env->IsSameObject(lock1, monitors[0]) && !env->IsSameObject(lock2, monitors[0])) {
142 result = STATUS_FAILED; 144 result = STATUS_FAILED;
143 printf("Point %d: not expected monitor: 0x%p\n", point, monitors[0]); 145 printf("Point %d: not expected monitor: 0x%p\n", point, monitors[0]);