Get rid of use of reflection to call Thread.isVirtual() in nsk/jdi/EventRequestManager/stepRequests/stepreq001t.java

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Fixed
    • Priority: P4
    • 22
    • Affects Version/s: 21
    • Component/s: core-svc
    • None
    • b11

      The following code is in nsk/jdi/EventRequestManager/stepRequests/stepreq001t.java:

          private static boolean isVirtual(Thread thread) {
              try {
                  Method isVirtual = Thread.class.getMethod("isVirtual");
                  return (boolean) isVirtual.invoke(thread);
              } catch (Exception e) {
                  throw new RuntimeException(e);
              }
          }

      I think this is a relic from the early days of loom when Thread.isVirtual() was not yet a public method. It can be removed and the callers can call Thread.isVirtual() directly.

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

              Created:
              Updated:
              Resolved: