tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kin...@apache.org
Subject cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler Generator.java
Date Sat, 27 Mar 2004 00:52:55 GMT
kinman      2004/03/26 16:52:55

  Modified:    jasper2/src/share/org/apache/jasper/compiler Generator.java
  Log:
  - Fix bugzilla 27665: Nested tags with scripting variables generates
    invalid code
  
  Revision  Changes    Path
  1.230     +16 -0     jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Generator.java
  
  Index: Generator.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Generator.java,v
  retrieving revision 1.229
  retrieving revision 1.230
  diff -u -r1.229 -r1.230
  --- Generator.java	25 Mar 2004 21:53:12 -0000	1.229
  +++ Generator.java	27 Mar 2004 00:52:55 -0000	1.230
  @@ -2468,6 +2468,10 @@
                   for (int i = 0; i < varInfos.length; i++) {
                       if (varInfos[i].getScope() != scope)
                           continue;
  +                    // If the scripting variable has been declared, skip codes
  +                    // for saving and restoring it.
  +                    if (n.getScriptingVars(scope).contains(varInfos[i]))
  +                        continue;
                       String varName = varInfos[i].getVarName();
                       String tmpVarName =
                           "_jspx_" + varName + "_" + n.getCustomNestingLevel();
  @@ -2480,6 +2484,10 @@
                   for (int i = 0; i < tagVarInfos.length; i++) {
                       if (tagVarInfos[i].getScope() != scope)
                           continue;
  +                    // If the scripting variable has been declared, skip codes
  +                    // for saving and restoring it.
  +                    if (n.getScriptingVars(scope).contains(tagVarInfos[i]))
  +                        continue;
                       String varName = tagVarInfos[i].getNameGiven();
                       if (varName == null) {
                           varName =
  @@ -2522,6 +2530,10 @@
                       if (varInfos[i].getScope() != scope)
                           continue;
                       String varName = varInfos[i].getVarName();
  +                    // If the scripting variable has been declared, skip codes
  +                    // for saving and restoring it.
  +                    if (n.getScriptingVars(scope).contains(varInfos[i]))
  +                        continue;
                       String tmpVarName =
                           "_jspx_" + varName + "_" + n.getCustomNestingLevel();
                       out.printin(varName);
  @@ -2532,6 +2544,10 @@
               } else {
                   for (int i = 0; i < tagVarInfos.length; i++) {
                       if (tagVarInfos[i].getScope() != scope)
  +                        continue;
  +                    // If the scripting variable has been declared, skip codes
  +                    // for saving and restoring it.
  +                    if (n.getScriptingVars(scope).contains(tagVarInfos[i]))
                           continue;
                       String varName = tagVarInfos[i].getNameGiven();
                       if (varName == null) {
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


Mime
View raw message