Fix regression in previous fix for https://issues.apache.org/bugzilla/show_bug.cgi...
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Sat, 29 Aug 2009 13:24:18 +0000 (13:24 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Sat, 29 Aug 2009 13:24:18 +0000 (13:24 +0000)
Update list of introduced variables before the tag body is processed in case they are used in the tag body.

git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@809131 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/jasper/compiler/Generator.java

index 504a772..8ec6665 100644 (file)
@@ -1747,6 +1747,17 @@ class Generator {
                 generateLocalVariables(out, n);
             }
 
+            // Add the named objects to the list of 'introduced' names to enable
+            // a later test as per JSP.5.3
+            VariableInfo[] infos = n.getVariableInfos();
+            if (infos != null && infos.length > 0) {
+                for (int i = 0; i < infos.length; i++) {
+                    VariableInfo info = infos[i];
+                    if (info != null && info.getVarName() != null)
+                        pageInfo.getVarInfoNames().add(info.getVarName());
+                }
+            }
+            
             if (n.implementsSimpleTag()) {
                 generateCustomDoTag(n, handlerInfo, tagHandlerVar);
             } else {
@@ -1798,17 +1809,6 @@ class Generator {
                 out = outSave;
             }
             
-            // Add the named objects to the list of 'introduced' names to enable
-            // a later test as per JSP.5.3
-            VariableInfo[] infos = n.getVariableInfos();
-            if (infos != null && infos.length > 0) {
-                for (int i = 0; i < infos.length; i++) {
-                    VariableInfo info = infos[i];
-                    if (info != null && info.getVarName() != null)
-                        pageInfo.getVarInfoNames().add(info.getVarName());
-                }
-            }
-            
         }
 
         private static final String DOUBLE_QUOTE = "\\\"";