shiro-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kao...@apache.org
Subject svn commit: r911980 - /incubator/shiro/trunk/core/src/main/java/org/apache/shiro/SecurityUtils.java
Date Fri, 19 Feb 2010 20:52:37 GMT
Author: kaosko
Date: Fri Feb 19 20:52:36 2010
New Revision: 911980

URL: http://svn.apache.org/viewvc?rev=911980&view=rev
Log:
RESOLVED - issue SHIRO-110: Remove org.apache.shiro.mgt.SubjectBinder and its usages 
http://issues.apache.org/jira/browse/SHIRO-110
- As discussed on the users list, bind the newly created subject to ThreadContext if an existing
one wasn't found from the context

Modified:
    incubator/shiro/trunk/core/src/main/java/org/apache/shiro/SecurityUtils.java

Modified: incubator/shiro/trunk/core/src/main/java/org/apache/shiro/SecurityUtils.java
URL: http://svn.apache.org/viewvc/incubator/shiro/trunk/core/src/main/java/org/apache/shiro/SecurityUtils.java?rev=911980&r1=911979&r2=911980&view=diff
==============================================================================
--- incubator/shiro/trunk/core/src/main/java/org/apache/shiro/SecurityUtils.java (original)
+++ incubator/shiro/trunk/core/src/main/java/org/apache/shiro/SecurityUtils.java Fri Feb 19
20:52:36 2010
@@ -53,7 +53,10 @@
      */
     public static Subject getSubject() {
         Subject subject = ThreadContext.getSubject();
-        if (subject == null) subject = (new Subject.Builder()).buildSubject();
+        if (subject == null) {
+            subject = (new Subject.Builder()).buildSubject();
+            ThreadContext.bind(subject);
+        }
         return subject;
     }
 



Mime
View raw message