< prev index next >

test/jdk/java/lang/Thread/virtual/ThreadBuilders.java

Print this page
@@ -49,11 +49,10 @@
      /**
       * Returns a builder to create virtual threads that use the given scheduler.
       * @throws UnsupportedOperationException if custom schedulers are not supported
       */
      static Thread.Builder.OfVirtual virtualThreadBuilder(Executor scheduler) {
-         Thread.Builder.OfVirtual builder = Thread.ofVirtual();
          try {
              return (Thread.Builder.OfVirtual) VTBUILDER_CTOR.newInstance(scheduler);
          } catch (InvocationTargetException e) {
              Throwable cause = e.getCause();
              if (cause instanceof RuntimeException re) {
< prev index next >