}
});
t = Subject.doAsPrivileged(subject, action, null);
} finally {
if (runAsAdded) {
rolesGroup.removeMember(runAsPrincipal);
}
final Object p = previous;
doPrivileged(new PrivilegedExceptionAction<Object>() {
public Object run() throws Exception {
resetContainerContext(p);