+ log.debug(() -> uid + ": process doAs");
+ Subject subject = CurrentSubject.current();
+ T res;
+ if (subject != null) {
+ assert subject == getSubject();
+ try {
+ res = action.call();
+ } catch (Exception e) {
+ throw new CompletionException("Failed to execute action for " + subject, e);
+ }
+ } else {
+ res = CurrentSubject.callAs(getSubject(), action);
+ }