Author: markt Date: Fri Apr 25 14:12:59 2014 New Revision: 1590036 URL: http://svn.apache.org/r1590036 Log: Ensure TLD parser obtained from cache has correct value of blockExternal
Modified: tomcat/tc7.0.x/trunk/java/org/apache/catalina/startup/TldConfig.java tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml Modified: tomcat/tc7.0.x/trunk/java/org/apache/catalina/startup/TldConfig.java URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/startup/TldConfig.java?rev=1590036&r1=1590035&r2=1590036&view=diff ============================================================================== --- tomcat/tc7.0.x/trunk/java/org/apache/catalina/startup/TldConfig.java (original) +++ tomcat/tc7.0.x/trunk/java/org/apache/catalina/startup/TldConfig.java Fri Apr 25 14:12:59 2014 @@ -79,7 +79,7 @@ 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 @@ -89,20 +89,34 @@ public final class TldConfig implements boolean blockExternal) { Digester digester = null; - if (!validation) { + if (!validation && !blockExternal) { if (tldDigesters[0] == null) { tldDigesters[0] = DigesterFactory.newDigester(validation, true, new TldRuleSet(), blockExternal); tldDigesters[0].getParser(); } digester = tldDigesters[0]; - } else { + } else if (!validation && blockExternal) { if (tldDigesters[1] == null) { tldDigesters[1] = DigesterFactory.newDigester(validation, true, new TldRuleSet(), blockExternal); tldDigesters[1].getParser(); } digester = tldDigesters[1]; + } else if (validation && !blockExternal) { + if (tldDigesters[2] == null) { + tldDigesters[2] = DigesterFactory.newDigester(validation, + true, new TldRuleSet(), blockExternal); + tldDigesters[2].getParser(); + } + digester = tldDigesters[2]; + } else { + if (tldDigesters[3] == null) { + tldDigesters[3] = DigesterFactory.newDigester(validation, + true, new TldRuleSet(), blockExternal); + tldDigesters[3].getParser(); + } + digester = tldDigesters[3]; } return digester; } Modified: tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml?rev=1590036&r1=1590035&r2=1590036&view=diff ============================================================================== --- tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml (original) +++ tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml Fri Apr 25 14:12:59 2014 @@ -121,6 +121,10 @@ additional locations where, theoretically, a memory leak could occur. (markt) </add> + <fix> + Ensure that a TLD parser obtained from the cache has the correct value + of <code>blockExternal</code>. (markt) + </fix> </changelog> </subsection> <subsection name="Coyote"> --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org