< prev index next >

src/java.base/share/classes/javax/security/auth/Subject.java

Print this page
*** 434,11 ***
      public static <T> T callAs(final Subject subject,
              final Callable<T> action) throws CompletionException {
          Objects.requireNonNull(action);
          if (!SharedSecrets.getJavaLangAccess().allowSecurityManager()) {
              try {
!                 return ScopedValue.callWhere(SCOPED_SUBJECT, subject, action::call);
              } catch (Exception e) {
                  throw new CompletionException(e);
              }
          } else {
              try {
--- 434,11 ---
      public static <T> T callAs(final Subject subject,
              final Callable<T> action) throws CompletionException {
          Objects.requireNonNull(action);
          if (!SharedSecrets.getJavaLangAccess().allowSecurityManager()) {
              try {
!                 return ScopedValue.where(SCOPED_SUBJECT, subject).call(action::call);
              } catch (Exception e) {
                  throw new CompletionException(e);
              }
          } else {
              try {
< prev index next >