< prev index next >

test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/hotswap/HS204/hs204t001/hs204t001.cpp

Print this page
rev 52050 : [mq]: refactor

@@ -49,11 +49,11 @@
 static jint newClassSize;
 
 char *getClassName(jvmtiEnv *jvmti, jclass  klass) {
     char * className;
     char * generic;
-    if( !NSK_JVMTI_VERIFY(NSK_CPP_STUB4(GetClassSignature, jvmti, klass, &className, &generic))) {
+    if( !NSK_JVMTI_VERIFY(jvmti->GetClassSignature(klass, &className, &generic))) {
         nsk_jvmti_setFailStatus();
     }
     return className;
 }
 

@@ -73,11 +73,11 @@
             NSK_DISPLAY0("\nMyClass :: Successfully redefined..\n");
             redefineNumber++;
         } else {
             NSK_COMPLAIN0("\nMyClass :: Failed to redefine ..\n");
         }
-        /* if( (myTestClass =NSK_CPP_STUB2(NewGlobalRef,jni_env, klass)) == NULL) {
+        /* if( (myTestClass =jni_env->NewGlobalRef(klass)) == NULL) {
            NSK_COMPLAIN0("Failed to create global ref...");
            }
          */
     }
 }

@@ -98,11 +98,11 @@
             NSK_DISPLAY0("\nMyClass :: Successfully redefined..\n");
             redefineNumber++;
         } else {
             NSK_COMPLAIN0("\nMyClass :: Failed to redefine ..\n");
         }
-        if( (myTestClass = (jclass) NSK_CPP_STUB2(NewGlobalRef,jni_env, klass)) == NULL) {
+        if( (myTestClass = (jclass) jni_env->NewGlobalRef(klass)) == NULL) {
             NSK_COMPLAIN0("Failed to create global ref...");
         }
     }
 }
 

@@ -238,28 +238,28 @@
 JNIEXPORT void JNICALL
 Java_nsk_jvmti_scenarios_hotswap_HS204_hs204t001_hs204t001_setThread(JNIEnv * env,
                          jclass klass,
              jobject thread) {
     NSK_DISPLAY0(" Inside the setThread Method");
-    if (!NSK_JNI_VERIFY(env, (testClass =(jclass) NSK_CPP_STUB2(NewGlobalRef, env, klass)) != NULL))
+    if (!NSK_JNI_VERIFY(env, (testClass =(jclass) env->NewGlobalRef(klass)) != NULL))
         nsk_jvmti_setFailStatus();
-    if (!NSK_JNI_VERIFY(env, (testedThread =NSK_CPP_STUB2(NewGlobalRef, env, thread)) != NULL))
+    if (!NSK_JNI_VERIFY(env, (testedThread =env->NewGlobalRef(thread)) != NULL))
         nsk_jvmti_setFailStatus();
 }
 
 JNIEXPORT jboolean JNICALL
 Java_nsk_jvmti_scenarios_hotswap_HS204_hs204t001_hs204t001_suspendThread(JNIEnv * env,
         jclass klass,
         jobject thread) {
     jint state;
     NSK_DISPLAY0("---suspend thread .. \n");
-    if (NSK_CPP_STUB3(GetThreadState,jvmti,thread, &state) == JVMTI_ERROR_NONE) {
+    if (jvmti->GetThreadState(thread, &state) == JVMTI_ERROR_NONE) {
         NSK_DISPLAY0(" No Errors in finding state of the thread.\n");
         if (state & JVMTI_THREAD_STATE_ALIVE) {
             NSK_DISPLAY0(" Thread state is alive .. So can be suspend should be possible ..\n");
             nsk_jvmti_disableNotification(jvmti, JVMTI_EVENT_SINGLE_STEP, thread);
-            if (!NSK_JVMTI_VERIFY(  NSK_CPP_STUB2(SuspendThread, jvmti, thread))) {
+            if (!NSK_JVMTI_VERIFY(  jvmti->SuspendThread(thread))) {
                 NSK_COMPLAIN0("TEST FAILED: unable to suspend the thread \n");
                 nsk_jvmti_setFailStatus();
                 return NSK_FALSE;
             } else {
                 NSK_DISPLAY0(" Sucessfully suspended Thread..\n" );

@@ -276,23 +276,23 @@
 Java_nsk_jvmti_scenarios_hotswap_HS204_hs204t001_hs204t001_popFrame(JNIEnv * env,
         jclass klass,
         jthread thread) {
     jint state;
     NSK_DISPLAY0("Inside pop_Frame method.....\n");
-    if (NSK_CPP_STUB3(GetThreadState,jvmti,thread, &state) == JVMTI_ERROR_NONE) {
+    if (jvmti->GetThreadState(thread, &state) == JVMTI_ERROR_NONE) {
         NSK_DISPLAY0(" Got the state of thread \n");
         if ( state & JVMTI_THREAD_STATE_SUSPENDED) {
             NSK_DISPLAY0(" Thread is already in suspended mode..\n");
-            if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(PopFrame, jvmti, thread))) {
+            if (!NSK_JVMTI_VERIFY(jvmti->PopFrame(thread))) {
                 NSK_COMPLAIN0(" TEST FAILED: UNABLE TO POP FRAME \n");
                 nsk_jvmti_setFailStatus();
                 return NSK_FALSE;
             } else {
                 NSK_DISPLAY0(" Poped frame safely..");
             }
             /* We should resume that thread for next execution.. */
-            if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(ResumeThread, jvmti, thread))) {
+            if (!NSK_JVMTI_VERIFY(jvmti->ResumeThread(thread))) {
                 NSK_COMPLAIN0(" TEST FAILED: UNABLE TO Resume thread \n");
                 nsk_jvmti_setFailStatus();
                 return NSK_FALSE;
             } else {
                 NSK_DISPLAY0(" Resumed.. thread for next set of executions...");
< prev index next >