geronimo-scm mailing list archives

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

URL: http://svn.apache.org/viewvc?rev=1025811&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.1/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/AbstractWebModuleBuilder.java

Modified: geronimo/server/branches/2.1/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/AbstractWebModuleBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/AbstractWebModuleBuilder.java?rev=1025811&r1=1025810&r2=1025811&view=diff
==============================================================================
--- geronimo/server/branches/2.1/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/AbstractWebModuleBuilder.java
(original)
+++ geronimo/server/branches/2.1/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/AbstractWebModuleBuilder.java
Thu Oct 21 02:09:07 2010
@@ -508,10 +508,12 @@ public abstract class AbstractWebModuleB
                 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