Author: remy.maucherat(a)jboss.com
Date: 2012-10-23 11:22:47 -0400 (Tue, 23 Oct 2012)
New Revision: 2111
Modified:
branches/7.0.x/java/org/apache/catalina/core/StandardContext.java
branches/7.0.x/webapps/docs/changelog.xml
branches/7.2.x/src/main/java/org/apache/catalina/core/StandardContext.java
branches/7.2.x/webapps/docs/changelog.xml
Log:
AS7-5802: Fix oops recreating the filter config right after initializing it if the
corresponding filter registration was used.
Modified: branches/7.0.x/java/org/apache/catalina/core/StandardContext.java
===================================================================
--- branches/7.0.x/java/org/apache/catalina/core/StandardContext.java 2012-10-19 08:44:02
UTC (rev 2110)
+++ branches/7.0.x/java/org/apache/catalina/core/StandardContext.java 2012-10-23 15:22:47
UTC (rev 2111)
@@ -3260,18 +3260,20 @@
Iterator<String> names = filterDefs.keySet().iterator();
while (names.hasNext()) {
String name = names.next();
- if (getLogger().isDebugEnabled())
- getLogger().debug(" Starting filter '" + name +
"'");
- ApplicationFilterConfig filterConfig = null;
- try {
- filterConfig = new ApplicationFilterConfig
- (this, (FilterDef) filterDefs.get(name));
- filterConfig.getFilter();
- filterConfigs.put(name, filterConfig);
- } catch (Throwable t) {
- getLogger().error
- (sm.getString("standardContext.filterStart", name), t);
- ok = false;
+ ApplicationFilterConfig filterConfig = filterConfigs.get(name);
+ if (filterConfig == null) {
+ if (getLogger().isDebugEnabled())
+ getLogger().debug(" Starting filter '" + name +
"'");
+ try {
+ filterConfig = new ApplicationFilterConfig
+ (this, (FilterDef) filterDefs.get(name));
+ filterConfig.getFilter();
+ filterConfigs.put(name, filterConfig);
+ } catch (Throwable t) {
+ getLogger().error
+ (sm.getString("standardContext.filterStart", name), t);
+ ok = false;
+ }
}
}
Modified: branches/7.0.x/webapps/docs/changelog.xml
===================================================================
--- branches/7.0.x/webapps/docs/changelog.xml 2012-10-19 08:44:02 UTC (rev 2110)
+++ branches/7.0.x/webapps/docs/changelog.xml 2012-10-23 15:22:47 UTC (rev 2111)
@@ -16,6 +16,13 @@
<body>
<section name="JBoss Web 7.0.16.Final (remm)">
+ <subsection name="Catalina">
+ <changelog>
+ <fix>
+ <jboss-jira>AS7-5802</jboss-jira>: Fix problem with duplicated
filter instantiation when using a filter registration. (remm)
+ </fix>
+ </changelog>
+ </subsection>
<subsection name="Coyote">
<changelog>
<fix>
Modified: branches/7.2.x/src/main/java/org/apache/catalina/core/StandardContext.java
===================================================================
--- branches/7.2.x/src/main/java/org/apache/catalina/core/StandardContext.java 2012-10-19
08:44:02 UTC (rev 2110)
+++ branches/7.2.x/src/main/java/org/apache/catalina/core/StandardContext.java 2012-10-23
15:22:47 UTC (rev 2111)
@@ -3215,17 +3215,19 @@
Iterator<String> names = filterDefs.keySet().iterator();
while (names.hasNext()) {
String name = names.next();
- CatalinaLogger.CORE_LOGGER.startingFilter(name);
- if (getLogger().isDebugEnabled())
- getLogger().debug(" Starting filter '" + name +
"'");
- ApplicationFilterConfig filterConfig = null;
- try {
- filterConfig = new ApplicationFilterConfig(this, (FilterDef)
filterDefs.get(name));
- filterConfig.getFilter();
- filterConfigs.put(name, filterConfig);
- } catch (Throwable t) {
- getLogger().error(MESSAGES.errorStartingFilter(name), t);
- ok = false;
+ ApplicationFilterConfig filterConfig = filterConfigs.get(name);
+ if (filterConfig == null) {
+ CatalinaLogger.CORE_LOGGER.startingFilter(name);
+ if (getLogger().isDebugEnabled())
+ getLogger().debug(" Starting filter '" + name +
"'");
+ try {
+ filterConfig = new ApplicationFilterConfig(this, (FilterDef)
filterDefs.get(name));
+ filterConfig.getFilter();
+ filterConfigs.put(name, filterConfig);
+ } catch (Throwable t) {
+ getLogger().error(MESSAGES.errorStartingFilter(name), t);
+ ok = false;
+ }
}
}
Modified: branches/7.2.x/webapps/docs/changelog.xml
===================================================================
--- branches/7.2.x/webapps/docs/changelog.xml 2012-10-19 08:44:02 UTC (rev 2110)
+++ branches/7.2.x/webapps/docs/changelog.xml 2012-10-23 15:22:47 UTC (rev 2111)
@@ -23,6 +23,9 @@
<fix>
<jira>249</jira>: Respect URL session tracking when encoding.
(remm)
</fix>
+ <fix>
+ <jboss-jira>AS7-5802</jboss-jira>: Fix problem with duplicated
filter instantiation when using a filter registration. (remm)
+ </fix>
</changelog>
</subsection>
<subsection name="Coyote">
Show replies by date