Author: lhazlewood
Date: Tue Jan 17 19:30:19 2012
New Revision: 1232548

URL: http://svn.apache.org/viewvc?rev=1232548&view=rev
Log:
SHIRO-298: removed null assignment to guarantee local instance removal even in 
the event of a SessionException

Modified:
    
shiro/trunk/core/src/main/java/org/apache/shiro/subject/support/DelegatingSubject.java

Modified: 
shiro/trunk/core/src/main/java/org/apache/shiro/subject/support/DelegatingSubject.java
URL: 
http://svn.apache.org/viewvc/shiro/trunk/core/src/main/java/org/apache/shiro/subject/support/DelegatingSubject.java?rev=1232548&r1=1232547&r2=1232548&view=diff
==============================================================================
--- 
shiro/trunk/core/src/main/java/org/apache/shiro/subject/support/DelegatingSubject.java
 (original)
+++ 
shiro/trunk/core/src/main/java/org/apache/shiro/subject/support/DelegatingSubject.java
 Tue Jan 17 19:30:19 2012
@@ -455,11 +455,12 @@ public class DelegatingSubject implement
     }
 
     private void clearRunAsIdentities() {
+        //setting to null must occur before interacting with the session in 
case it throws an exception (SHIRO-298)
+        this.runAsPrincipals = null;
         Session session = getSession(false);
         if (session != null) {
             session.removeAttribute(RUN_AS_PRINCIPALS_SESSION_KEY);
         }
-        this.runAsPrincipals = null;
     }
 
     private void pushIdentity(PrincipalCollection principals) throws 
NullPointerException {


Reply via email to