shiro-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lhazlew...@apache.org
Subject svn commit: r816257 - /incubator/shiro/trunk/web/src/main/java/org/apache/shiro/web/filter/mgt/DefaultFilterChainManager.java
Date Thu, 17 Sep 2009 16:13:54 GMT
Author: lhazlewood
Date: Thu Sep 17 16:13:54 2009
New Revision: 816257

URL: http://svn.apache.org/viewvc?rev=816257&view=rev
Log:
Fixed issue where a filter with no configuration was not being added to processing paths

Modified:
    incubator/shiro/trunk/web/src/main/java/org/apache/shiro/web/filter/mgt/DefaultFilterChainManager.java

Modified: incubator/shiro/trunk/web/src/main/java/org/apache/shiro/web/filter/mgt/DefaultFilterChainManager.java
URL: http://svn.apache.org/viewvc/incubator/shiro/trunk/web/src/main/java/org/apache/shiro/web/filter/mgt/DefaultFilterChainManager.java?rev=816257&r1=816256&r2=816257&view=diff
==============================================================================
--- incubator/shiro/trunk/web/src/main/java/org/apache/shiro/web/filter/mgt/DefaultFilterChainManager.java
(original)
+++ incubator/shiro/trunk/web/src/main/java/org/apache/shiro/web/filter/mgt/DefaultFilterChainManager.java
Thu Sep 17 16:13:54 2009
@@ -182,9 +182,8 @@
                     "' to apply to chain [" + chainName + "] in the pool of available Filters.
 Ensure a " +
                     "filter with that name/path has first been registered with the addFilter
method(s).");
         }
-        if (StringUtils.hasText(chainSpecificFilterConfig)) {
-            applyChainConfig(chainName, filter, chainSpecificFilterConfig);
-        }
+
+        applyChainConfig(chainName, filter, chainSpecificFilterConfig);
 
         NamedFilterList chain = ensureChain(chainName);
         chain.add(filter);
@@ -198,11 +197,15 @@
         if (filter instanceof PathConfigProcessor) {
             ((PathConfigProcessor) filter).processPathConfig(chainName, chainSpecificFilterConfig);
         } else {
-            String msg = "chainSpecificFilterConfig was specified as a method argument, but
the underlying " +
-                    "Filter instance is not an 'instanceof' " +
-                    PathConfigProcessor.class.getName() + ".  This is required if the filter
is to accept " +
-                    "chain-specific configuration.";
-            throw new ConfigurationException(msg);
+            if (StringUtils.hasText(chainSpecificFilterConfig)) {
+                //they specified a filter configuration, but the Filter doesn't implement
PathConfigProcessor
+                //this is an erroneous config:
+                String msg = "chainSpecificFilterConfig was specified, but the underlying
" +
+                        "Filter instance is not an 'instanceof' " +
+                        PathConfigProcessor.class.getName() + ".  This is required if the
filter is to accept " +
+                        "chain-specific configuration.";
+                throw new ConfigurationException(msg);
+            }
         }
     }
 



Mime
View raw message