@Override public <T, R> R execute(Function<T, R> function, T t) { try { return doPrivileged((PrivilegedExceptionAction<R>) () -> NON_PRIVILEGED.execute(function, t) ); } catch (PrivilegedActionException e) { throwConverted(e); // Not reachable throw new IllegalStateException(); } } @Override
@Override public <T, U, R> R execute(BiFunction<T, U, R> function, T t, U u) { try { return doPrivileged((PrivilegedExceptionAction<R>) () -> NON_PRIVILEGED.execute(function, t, u) ); } catch (PrivilegedActionException e) { throwConverted(e); // Not reachable throw new IllegalStateException(); } } };
@Override public <T, U, R> R execute(BiFunction<T, U, R> function, T t, U u) { try { return doPrivileged((PrivilegedExceptionAction<R>) () -> NON_PRIVILEGED.execute(function, t, u) ); } catch (PrivilegedActionException e) { throwConverted(e); // Not reachable throw new IllegalStateException(); } } };
/** * Execute the given function, in a privileged block if a security manager is checking. * @param function the function * @param t the first argument to the function * @param u the second argument to the function * @param <T> the type of the first argument to the function * @param <U> the type of the second argument to the function * @param <R> the type of the function return value * @return the return value of the function */ static <T, U, R> R privilegedExecution(BiFunction<T, U, R> function, T t, U u) { return privilegedExecution().execute(function, t, u); }
@Override public <T, R> R execute(Function<T, R> function, T t) { try { return doPrivileged((PrivilegedExceptionAction<R>) () -> NON_PRIVILEGED.execute(function, t) ); } catch (PrivilegedActionException e) { throwConverted(e); // Not reachable throw new IllegalStateException(); } } @Override
/** * Execute the given function, in a privileged block if a security manager is checking. * @param function the function * @param t the argument to the function * @param <T> the type of the argument to the function * @param <R> the type of the function return value * @return the return value of the function */ static <T, R> R privilegedExecution(Function<T, R> function, T t) { return privilegedExecution().execute(function, t); }
/** * Execute the given function, in a privileged block if a security manager is checking. * @param function the function * @param t the argument to the function * @param <T> the type of the argument to the function * @param <R> the type of the function return value * @return the return value of the function */ static <T, R> R privilegedExecution(Function<T, R> function, T t) { return privilegedExecution().execute(function, t); }
/** * Execute the given function, in a privileged block if a security manager is checking. * @param function the function * @param t the first argument to the function * @param u the second argument to the function * @param <T> the type of the first argument to the function * @param <U> the type of the second argument to the function * @param <R> the type of the function return value * @return the return value of the function */ static <T, U, R> R privilegedExecution(BiFunction<T, U, R> function, T t, U u) { return privilegedExecution().execute(function, t, u); }