Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8355214

nsk/jdi/ThreadStartRequest/addThreadFilter/addthreadfilter001.java should use JDIBase superclass

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 25
    • 25
    • core-svc
    • master

      There is nsk/jdi superclass called JDIBase that many tests inherit from. It provides common functionality like log support, basic event handling, support for setting a breakpoint, and support for the communcation breakpoint that the debugger and debuggee used to synchronize with. addthreadfilter001 does not inherit from JDIBase and instead implements all this functionality in the test. The reason is because it provides a slightly modified version of the JDIBase.breakpointForCommunication() method.

                      } else if (event instanceof ThreadStartEvent) {
                          // It might be the case that while the thread start request was enabled
                          // some threads not related to the test ( e.g. JVMCI threads) were started
                          // and generated thread start events. We ignore these thread start events
                          // and keep waiting for a breakpoint event.
                          ThreadStartEvent tse = (ThreadStartEvent) event;
                          log2("ThreadStartEvent is received while waiting for a breakpoint" +
                                  " event, thread: : " + tse.thread().name());
                          continue;
                      }

      However, this code seems to predate adding similar code to the JDIBase version of breakpointForCommunication():

                  if (EventFilters.filtered(event)) {
                      // We filter out spurious ThreadStartEvents
                      continue;
                  }

      This test should use JDIBase and get rid of all the overrides it has in place, and also be updated to use the new JDIBase.breakpointForCommunication() method.

            cjplummer Chris Plummer
            cjplummer Chris Plummer
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: