< prev index next >

test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/extension/EX03/ex03t001/ex03t001.cpp

Print this page
@@ -128,10 +128,11 @@
  
  jboolean enableClassUnloadEvent (jboolean enable) {
      jint extCount, i;
      jvmtiExtensionEventInfo* extList;
      jboolean found = JNI_FALSE;
+     jvmtiEventMode mode = enable ? JVMTI_ENABLE : JVMTI_DISABLE;
  
      NSK_DISPLAY0("Get extension events list\n");
      if (!NSK_JVMTI_VERIFY(jvmti->GetExtensionEvents(&extCount, &extList))) {
          nsk_jvmti_setFailStatus();
          return JNI_FALSE;

@@ -153,10 +154,15 @@
                      jvmti->SetExtensionEventCallback(extList[i].extension_event_index,
                                                       enable ? (jvmtiExtensionEvent)ClassUnload : NULL))) {
                  nsk_jvmti_setFailStatus();
                  return JNI_FALSE;
              }
+             if (!NSK_JVMTI_VERIFY(
+                     jvmti->SetEventNotificationMode(mode, (jvmtiEvent)extList[i].extension_event_index, NULL))) {
+                 nsk_jvmti_setFailStatus();
+                 return JNI_FALSE;
+             }
              eventEnabled = enable;
              if (enable == JNI_TRUE) {
                  NSK_DISPLAY1("%s callback enabled\n", extList[i].id);
              } else {
                  NSK_DISPLAY1("%s callback disabled\n", extList[i].id);
< prev index next >