< prev index next >

## src/java.base/share/classes/java/util/concurrent/Executors.java

Print this page

    @@ -387,11 +387,19 @@
           *
           * @return a thread factory
           * @throws AccessControlException if the current access control
           * context does not have permission to both get and set context
           * class loader
    +      *
    +      * @deprecated This method is only useful in conjunction with
    +      *       {@linkplain SecurityManager the Security Manager}, which is
    +      *       deprecated and subject to removal in a future release.
    +      *       Consequently, this method is also deprecated and subject to
    +      *       removal. There is no replacement for the Security Manager or this
    +      *       method.
           */
    +     @Deprecated(since="17", forRemoval=true)
          public static ThreadFactory privilegedThreadFactory() {
              return new PrivilegedThreadFactory();
          }

          /**

    @@ -464,11 +472,19 @@
           * AccessControlException}.
           * @param callable the underlying task
           * @param <T> the type of the callable's result
           * @return a callable object
           * @throws NullPointerException if callable null
    +      *
    +      * @deprecated This method is only useful in conjunction with
    +      *       {@linkplain SecurityManager the Security Manager}, which is
    +      *       deprecated and subject to removal in a future release.
    +      *       Consequently, this method is also deprecated and subject to
    +      *       removal. There is no replacement for the Security Manager or this
    +      *       method.
           */
    +     @Deprecated(since="17", forRemoval=true)
          public static <T> Callable<T> privilegedCallable(Callable<T> callable) {
              if (callable == null)
                  throw new NullPointerException();
              return new PrivilegedCallable<T>(callable);
          }

    @@ -490,11 +506,19 @@
           * @return a callable object
           * @throws NullPointerException if callable null
           * @throws AccessControlException if the current access control
           * context does not have permission to both set and get context
           * class loader
    +      *
    +      * @deprecated This method is only useful in conjunction with
    +      *       {@linkplain SecurityManager the Security Manager}, which is
    +      *       deprecated and subject to removal in a future release.
    +      *       Consequently, this method is also deprecated and subject to
    +      *       removal. There is no replacement for the Security Manager or this
    +      *       method.
           */
    +     @Deprecated(since="17", forRemoval=true)
          public static <T> Callable<T> privilegedCallableUsingCurrentClassLoader(Callable<T> callable) {
              if (callable == null)
                  throw new NullPointerException();
              return new PrivilegedCallableUsingCurrentClassLoader<T>(callable);
          }

< prev index next >