@Test public void testGetCurrentSubject() { final Subject subject = new Subject(); assertThat(Subject.doAs(subject, new PrivilegedAction<Subject>() { @Override public Subject run() { return JaasUtils.getCurrentSubject(); } })).isEqualTo(subject); }
public static Subject getCurrentSubject() { final Subject subject = Subject.getSubject(AccessController.getContext()); if (subject == null) throw new IllegalStateException("No subject found in current context."); return subject; }
JaasUtils { public static Subject getCurrentSubject() { final Subject subject = Subject.getSubject(AccessController.getContext()); if (subject == null) throw new IllegalStateException("No subject found in current context."); return subject; } }
JaasUtils { public static Subject getCurrentSubject() { final Subject subject = Subject.getSubject(AccessController.getContext()); if (subject == null) throw new IllegalStateException("No subject found in current context."); return subject; }  }
JaasUtils { public static Subject getCurrentSubject() { final Subject subject = Subject.getSubject(AccessController.getContext()); if (subject == null) throw new IllegalStateException("No subject found in current context."); return subject; }  static Subject getCurrentSubject(); static P getPrincipal(final Class<P> principalClass); static T getPrivateCredential(final Class<T> credentialClass); static boolean hasPrincipal(final Class<? extends Principal> principalClass); }
JaasUtils { public static Subject getCurrentSubject() { final Subject subject = Subject.getSubject(AccessController.getContext()); if (subject == null) throw new IllegalStateException("No subject found in current context."); return subject; }  static Subject getCurrentSubject(); static P getPrincipal(final Class<P> principalClass); static T getPrivateCredential(final Class<T> credentialClass); static boolean hasPrincipal(final Class<? extends Principal> principalClass);  }