shiro-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lhazlew...@apache.org
Subject svn commit: r1232548 - /shiro/trunk/core/src/main/java/org/apache/shiro/subject/support/DelegatingSubject.java
Date Tue, 17 Jan 2012 19:30:19 GMT
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
{



Mime
View raw message