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

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

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 22
    • 21
    • 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.

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

              Created:
              Updated:
              Resolved: