< prev index next >

src/java.base/share/classes/jdk/internal/vm/ScopedValueContainer.java

Print this page
@@ -23,16 +23,14 @@
   * questions.
   */
  package jdk.internal.vm;
  
  import java.util.concurrent.Callable;
+ import java.util.concurrent.StructureViolationException;
  import jdk.internal.access.JavaLangAccess;
  import jdk.internal.access.SharedSecrets;
- import jdk.internal.misc.StructureViolationExceptions;
  import jdk.internal.misc.Unsafe;
- import jdk.internal.vm.annotation.DontInline;
- import jdk.internal.vm.annotation.ReservedStackAccess;
  
  /**
   * A StackableScope to represent scoped-value bindings.
   *
   * This class defines static methods to run an operation with a ScopedValueContainer

@@ -40,11 +38,11 @@
   * and a method to return a snapshot of the scoped value bindings.
   */
  public class ScopedValueContainer extends StackableScope {
      private static final JavaLangAccess JLA = SharedSecrets.getJavaLangAccess();
      static {
-         Unsafe.getUnsafe().ensureClassInitialized(StructureViolationExceptions.class);
+         Unsafe.getUnsafe().ensureClassInitialized(StructureViolationException.class);
      }
  
      private ScopedValueContainer() {
      }
  

@@ -141,11 +139,11 @@
      }
  
      /**
       * For use by ScopedValue to call a value returning operation in a structured context.
       */
-     public static <V> V call(Callable<V> op) throws Exception {
+     public static <V> V call(Callable<V> op) {
          if (head() == null) {
              // no need to push scope when stack is empty
              return callWithoutScope(op);
          } else {
              return new ScopedValueContainer().doCall(op);

@@ -200,11 +198,11 @@
       * as a suppressed exception when {@code atTop} is false.
       */
      private static void throwIfFailed(Throwable ex, boolean atTop) {
          if (ex != null || !atTop) {
              if (!atTop) {
-                 var sve = StructureViolationExceptions.newException();
+                 var sve = new StructureViolationException();
                  if (ex == null) {
                      ex = sve;
                  } else {
                      ex.addSuppressed(sve);
                  }
< prev index next >