test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/hotswap/HS104/hs104t001/hs104t001.cpp
changeset 57683 1cf884e437ea
parent 57629 7aba63ce3b3a
child 58679 9c3209ff7550
equal deleted inserted replaced
57681:41f2f2829a09 57683:1cf884e437ea
    44     jvmti->GetClassSignature(klass, &className, &generic);
    44     jvmti->GetClassSignature(klass, &className, &generic);
    45     if (strcmp(className, CLASS_NAME) == 0) {
    45     if (strcmp(className, CLASS_NAME) == 0) {
    46         char fileName[512];
    46         char fileName[512];
    47         nsk_jvmti_getFileName(0, FILE_NAME, fileName,
    47         nsk_jvmti_getFileName(0, FILE_NAME, fileName,
    48                         sizeof(fileName)/sizeof(char));
    48                         sizeof(fileName)/sizeof(char));
    49         if (nsk_jvmti_redefineClass(jvmti, klass, fileName) == NSK_TRUE) {
    49         if (nsk_jvmti_redefineClass(jvmti, klass, fileName)) {
    50             nsk_printf("Agent:: Successfully redefined..");
    50             nsk_printf("Agent:: Successfully redefined..");
    51             if (nsk_jvmti_disableNotification(jvmti,JVMTI_EVENT_CLASS_PREPARE, NULL) == NSK_TRUE) {
    51             if (nsk_jvmti_disableNotification(jvmti,JVMTI_EVENT_CLASS_PREPARE, NULL)) {
    52                 nsk_printf(" Agent :: NOTIFICATIONS ARE DISABLED \n");
    52                 nsk_printf(" Agent :: NOTIFICATIONS ARE DISABLED \n");
    53             } else {
    53             } else {
    54                 nsk_printf(" Agent :: Failed to disabled \n");
    54                 nsk_printf(" Agent :: Failed to disabled \n");
    55             }
    55             }
    56         } else {
    56         } else {
    94         rc=jvmti->SetEventCallbacks(&eventCallbacks, sizeof(eventCallbacks));
    94         rc=jvmti->SetEventCallbacks(&eventCallbacks, sizeof(eventCallbacks));
    95         if (rc != JVMTI_ERROR_NONE) {
    95         if (rc != JVMTI_ERROR_NONE) {
    96             nsk_printf(" Agent:: Error occured while setting event call back \n");
    96             nsk_printf(" Agent:: Error occured while setting event call back \n");
    97             return JNI_ERR;
    97             return JNI_ERR;
    98         }
    98         }
    99         if (nsk_jvmti_enableNotification(jvmti,
    99         if (nsk_jvmti_enableNotification(jvmti, JVMTI_EVENT_CLASS_PREPARE, NULL)) {
   100                     JVMTI_EVENT_CLASS_PREPARE, NULL) == NSK_TRUE) {
       
   101             nsk_printf("Agent :: NOTIFICATIONS ARE ENABLED \n");
   100             nsk_printf("Agent :: NOTIFICATIONS ARE ENABLED \n");
   102         } else {
   101         } else {
   103             nsk_printf(" Error in Eanableing Notifications..");
   102             nsk_printf(" Error in Eanableing Notifications..");
   104         }
   103         }
   105     }
   104     }