< prev index next >

test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jni/BooleanArrayCriticalLocker.cpp

Print this page
rev 52828 : 8213501: Deploy ExceptionJniWrapper for a few tests
Summary:
Reviewed-by:

@@ -35,42 +35,42 @@
  * Method:    criticalNative
  * Signature: ([Z)Z
  */
 JNIEXPORT jboolean JNICALL Java_nsk_share_gc_lock_jni_BooleanArrayCriticalLocker_criticalNative
 (JNIEnv *jni_env, jobject o, jlong enterTime, jlong sleepTime) {
-        ExceptionCheckingJniEnvPtr env(jni_env);
+        ExceptionCheckingJniEnvPtr jni(jni_env);
 
         jsize size, i;
         jbooleanArray arr;
         jboolean *pa;
         jboolean hash = JNI_TRUE;
         time_t start_time, current_time;
 
         if (objFieldId == NULL) {
-                jclass klass = env->GetObjectClass(o);
-                objFieldId = env->GetFieldID(klass, "obj", "Ljava/lang/Object;");
+                jclass klass = jni->GetObjectClass(o, TRACE_JNI_CALL);
+                objFieldId = jni->GetFieldID(klass, "obj", "Ljava/lang/Object;", TRACE_JNI_CALL);
         }
-        arr = (jbooleanArray) env->GetObjectField(o, objFieldId);
-        env->SetObjectField(o, objFieldId, NULL);
+        arr = (jbooleanArray) jni->GetObjectField(o, objFieldId, TRACE_JNI_CALL);
+        jni->SetObjectField(o, objFieldId, NULL, TRACE_JNI_CALL);
 
-        size = env->GetArrayLength(arr);
+        size = jni->GetArrayLength(arr, TRACE_JNI_CALL);
         start_time = time(NULL);
         enterTime /= 1000;
         current_time = 0;
         while (current_time - start_time < enterTime) {
-                pa = (jboolean*) env->GetPrimitiveArrayCritical(arr, NULL);
+                pa = (jboolean*) jni->GetPrimitiveArrayCritical(arr, NULL, TRACE_JNI_CALL);
                 if (pa != NULL) {
                         for (i = 0; i < size; ++i)
                                 hash ^= pa[i];
                 } else {
                         hash = JNI_FALSE;
                 }
                 mssleep((long) sleepTime);
-                env->ReleasePrimitiveArrayCritical(arr, pa, 0);
+                jni->ReleasePrimitiveArrayCritical(arr, pa, 0, TRACE_JNI_CALL);
                 mssleep((long) sleepTime);
                 current_time = time(NULL);
         }
-        env->SetObjectField(o, objFieldId, arr);
+        jni->SetObjectField(o, objFieldId, arr, TRACE_JNI_CALL);
         return hash;
 }
 
 }
< prev index next >