Author: markt
Date: Mon Jan 17 17:12:36 2011
New Revision: 1059993
URL: http://svn.apache.org/viewvc?rev=1059993&view=rev
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=50597
Don't instantiate a new instance of a Filter if an instance was provided via
the ServletContext.addFilter(String, Filter) method.
Patch provided by Ismael Juma.
Modified:
tomcat/trunk/java/org/apache/catalina/core/ApplicationFilterConfig.java
tomcat/trunk/webapps/docs/changelog.xml
Modified:
tomcat/trunk/java/org/apache/catalina/core/ApplicationFilterConfig.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/ApplicationFilterConfig.java?rev=1059993&r1=1059992&r2=1059993&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/core/ApplicationFilterConfig.java
(original)
+++ tomcat/trunk/java/org/apache/catalina/core/ApplicationFilterConfig.java Mon
Jan 17 17:12:36 2011
@@ -367,10 +367,10 @@ public final class ApplicationFilterConf
this.filter = null;
} else {
-
- // Allocate a new filter instance
- getFilter();
-
+ // Allocate a new filter instance if necessary
+ if (filterDef.getFilter() == null) {
+ getFilter();
+ }
}
}
Modified: tomcat/trunk/webapps/docs/changelog.xml
URL:
http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=1059993&r1=1059992&r2=1059993&view=diff
==============================================================================
--- tomcat/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/trunk/webapps/docs/changelog.xml Mon Jan 17 17:12:36 2011
@@ -69,6 +69,12 @@
<bug>50582</bug>: Refactor access logging so chunked encoding is not
forced for all requests if bytes sent is logged. (markt)
</fix>
+ <fix>
+ <bug>50597</bug>: Don't instantiate a new instance of a Filter if
+ an instance was provided via the
+ <code>ServletContext.addFilter(String, Filter)</code> method. Patch
+ provided by Ismael Juma. (markt)
+ </fix>
</changelog>
</subsection>
<subsection name="Jasper">
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]