Author: kkolinko
Date: Sun May 11 16:44:03 2014
New Revision: 1593815
URL: http://svn.apache.org/r1593815
Log:
Ensure TLD parser obtained from cache has correct value of blockExternal
(r1590036 + r1590040 + r1590065)
Modified:
tomcat/tc6.0.x/trunk/STATUS.txt
tomcat/tc6.0.x/trunk/java/org/apache/catalina/startup/TldConfig.java
tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml
Modified: tomcat/tc6.0.x/trunk/STATUS.txt
URL:
http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/STATUS.txt?rev=1593815&r1=1593814&r2=1593815&view=diff
==============================================================================
--- tomcat/tc6.0.x/trunk/STATUS.txt (original)
+++ tomcat/tc6.0.x/trunk/STATUS.txt Sun May 11 16:44:03 2014
@@ -34,12 +34,6 @@ PATCHES PROPOSED TO BACKPORT:
+1: markt, kkolinko, fhanik
-1:
-* Ensure TLD parser obtained from cache has correct value of blockExternal
- (r1590036 + r1590040 + r1590065)
- https://people.apache.org/~kkolinko/patches/2014-04-26_tc6_TldConfig.patch
- +1: kkolinko, markt, fhanik
- -1:
-
* Followup to r1589635
To simplify code and align it with TC7 & 8.
(Discussed in Re:r1589635)
Modified: tomcat/tc6.0.x/trunk/java/org/apache/catalina/startup/TldConfig.java
URL:
http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/catalina/startup/TldConfig.java?rev=1593815&r1=1593814&r2=1593815&view=diff
==============================================================================
--- tomcat/tc6.0.x/trunk/java/org/apache/catalina/startup/TldConfig.java
(original)
+++ tomcat/tc6.0.x/trunk/java/org/apache/catalina/startup/TldConfig.java Sun
May 11 16:44:03 2014
@@ -138,30 +138,29 @@ public final class TldConfig implements
/**
* The <code>Digester</code>s available to process tld files.
*/
- private static Digester[] tldDigesters = new Digester[2];
+ private static Digester[] tldDigesters = new Digester[4];
/**
* Create (if necessary) and return a Digester configured to process the
* tld.
*/
- private static Digester createTldDigester(boolean validation,
+ private static synchronized Digester createTldDigester(boolean validation,
boolean blockExternal) {
- Digester digester = null;
- if (!validation) {
- if (tldDigesters[0] == null) {
- tldDigesters[0] = DigesterFactory.newDigester(validation,
- true, new TldRuleSet(), blockExternal);
- tldDigesters[0].getParser();
- }
- digester = tldDigesters[0];
- } else {
- if (tldDigesters[1] == null) {
- tldDigesters[1] = DigesterFactory.newDigester(validation,
- true, new TldRuleSet(), blockExternal);
- tldDigesters[1].getParser();
- }
- digester = tldDigesters[1];
+ Digester digester;
+ int cacheIndex = 0;
+ if (validation) {
+ cacheIndex += 1;
+ }
+ if (blockExternal) {
+ cacheIndex += 2;
+ }
+ digester = tldDigesters[cacheIndex];
+ if (digester == null) {
+ digester = DigesterFactory.newDigester(validation,
+ true, new TldRuleSet(), blockExternal);
+ digester.getParser();
+ tldDigesters[cacheIndex] = digester;
}
return digester;
}
Modified: tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml
URL:
http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml?rev=1593815&r1=1593814&r2=1593815&view=diff
==============================================================================
--- tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml Sun May 11 16:44:03 2014
@@ -95,6 +95,10 @@
Only create XML parsing objects if required and fix associated
potential
memory leak in the default Servlet. (markt)
</fix>
+ <fix>
+ Ensure that a TLD parser obtained from the cache has the correct value
+ of <code>blockExternal</code>. (markt/kkolinko)
+ </fix>
</changelog>
</subsection>
<subsection name="Coyote">
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]