geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From genspr...@apache.org
Subject svn commit: r1025810 - /geronimo/server/branches/2.2/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/security/SpecSecurityBuilder.java
Date Thu, 21 Oct 2010 02:09:00 GMT
Author: genspring
Date: Thu Oct 21 02:09:00 2010
New Revision: 1025810

URL: http://svn.apache.org/viewvc?rev=1025810&view=rev
Log:
Somehow, once currentRolePatterns = new HashMap<String, URLPattern>(); is executed.currentPatterns
will point to the same reference of currentRolePatterns.

    Pull (currentPatterns ==null) out of the loop to avoid the unexpected logic caused by
the problem above.

Modified:
    geronimo/server/branches/2.2/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/security/SpecSecurityBuilder.java

Modified: geronimo/server/branches/2.2/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/security/SpecSecurityBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.2/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/security/SpecSecurityBuilder.java?rev=1025810&r1=1025809&r2=1025810&view=diff
==============================================================================
--- geronimo/server/branches/2.2/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/security/SpecSecurityBuilder.java
(original)
+++ geronimo/server/branches/2.2/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/security/SpecSecurityBuilder.java
Thu Oct 21 02:09:00 2010
@@ -105,11 +105,13 @@ public class SpecSecurityBuilder {
             if (securityConstraintType.isSetUserDataConstraint()) {
                 transport = securityConstraintType.getUserDataConstraint().getTransportGuarantee().getStringValue().trim().toUpperCase();
             }
+            
+            boolean isRolebasedPatten = (currentPatterns == null);
 
             for (WebResourceCollectionType webResourceCollectionType : securityConstraintType.getWebResourceCollectionArray())
{
                 for (UrlPatternType urlPatternType : webResourceCollectionType.getUrlPatternArray())
{
                     String url = urlPatternType.getStringValue().trim();
-                    if(currentPatterns == null) {
+                    if(isRolebasedPatten) {
                         for (String roleName : roleNames) {
                             Map<String, URLPattern> currentRolePatterns = rolesPatterns.get(roleName);
                             if (currentRolePatterns == null) {



Mime
View raw message