From 90824bc48062f70bc972befa9b593d548c5f1fac Mon Sep 17 00:00:00 2001 From: markt Date: Wed, 23 May 2007 02:42:08 +0000 Subject: [PATCH] Port fix for bug 42438. Duplicate temp variable was created. Patch provided by Brian Lenz. git-svn-id: https://svn.apache.org/repos/asf/tomcat/tc6.0.x/trunk@540810 13f79535-47bb-0310-9956-ffa450edef68 --- java/org/apache/jasper/compiler/Node.java | 4 +++- webapps/docs/changelog.xml | 9 +++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/java/org/apache/jasper/compiler/Node.java b/java/org/apache/jasper/compiler/Node.java index 7e9fdf983..fc05627f3 100644 --- a/java/org/apache/jasper/compiler/Node.java +++ b/java/org/apache/jasper/compiler/Node.java @@ -1861,7 +1861,6 @@ abstract class Node implements TagConstants { super(qName, ATTRIBUTE_ACTION, attrs, nonTaglibXmlnsAttrs, taglibAttrs, start, parent); - temporaryVariableName = JspUtil.nextTemporaryVariableName(); if ("false".equals(this.getAttributeValue("trim"))) { // (if null or true, leave default of true) trim = false; @@ -1908,6 +1907,9 @@ abstract class Node implements TagConstants { * (this probably could go elsewhere, but it's convenient here) */ public String getTemporaryVariableName() { + if (temporaryVariableName == null) { + temporaryVariableName = JspUtil.nextTemporaryVariableName(); + } return temporaryVariableName; } diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml index c45001169..5f2921852 100644 --- a/webapps/docs/changelog.xml +++ b/webapps/docs/changelog.xml @@ -36,6 +36,15 @@ + + + + 42438 Duplicate temporary variables were created when + jsp:attribute was used in conjunction with custom tags. Patch provided + by Brian Lenz. (markt) + + + -- 2.11.0