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

Details

    • Enhancement
    • Resolution: Fixed
    • P4
    • 22
    • 21
    • core-svc
    • None
    • b11

    Description

      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.

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: