tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1138950 - in /tomcat/trunk: java/org/apache/jasper/compiler/Generator.java webapps/docs/changelog.xml
Date Thu, 23 Jun 2011 15:51:56 GMT
Author: markt
Date: Thu Jun 23 15:51:55 2011
New Revision: 1138950

URL: http://svn.apache.org/viewvc?rev=1138950&view=rev
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=36362
Handle the case where tag file attributes (which can use any valid XML name) have a name which
is a Java identifier.

Modified:
    tomcat/trunk/java/org/apache/jasper/compiler/Generator.java
    tomcat/trunk/webapps/docs/changelog.xml

Modified: tomcat/trunk/java/org/apache/jasper/compiler/Generator.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/compiler/Generator.java?rev=1138950&r1=1138949&r2=1138950&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/jasper/compiler/Generator.java (original)
+++ tomcat/trunk/java/org/apache/jasper/compiler/Generator.java Thu Jun 23 15:51:55 2011
@@ -3675,13 +3675,16 @@ class Generator {
                 out.print(JspUtil.toJavaSourceType(attrInfos[i].getTypeName()));
                 out.print(" ");
             }
-            out.print(attrInfos[i].getName());
+            out.print(JspUtil.makeJavaIdentifier(attrInfos[i].getName()));
             out.println(";");
         }
         out.println();
 
         // Define attribute getter and setter methods
         for (int i = 0; i < attrInfos.length; i++) {
+            String javaName =
+                JspUtil.makeJavaIdentifier(attrInfos[i].getName());
+
             // getter method
             out.printin("public ");
             if (attrInfos[i].isFragment()) {
@@ -3694,7 +3697,7 @@ class Generator {
             out.println(" {");
             out.pushIndent();
             out.printin("return this.");
-            out.print(attrInfos[i].getName());
+            out.print(javaName);
             out.println(";");
             out.popIndent();
             out.printil("}");
@@ -3710,20 +3713,20 @@ class Generator {
                 out.print(JspUtil.toJavaSourceType(attrInfos[i].getTypeName()));
                 out.print(" ");
             }
-            out.print(attrInfos[i].getName());
+            out.print(javaName);
             out.println(") {");
             out.pushIndent();
             out.printin("this.");
-            out.print(attrInfos[i].getName());
+            out.print(javaName);
             out.print(" = ");
-            out.print(attrInfos[i].getName());
+            out.print(javaName);
             out.println(";");
             if (ctxt.isTagFile()) {
                 // Tag files should also set jspContext attributes
                 out.printin("jspContext.setAttribute(\"");
                 out.print(attrInfos[i].getName());
                 out.print("\", ");
-                out.print(attrInfos[i].getName());
+                out.print(javaName);
                 out.println(");");
             }
             out.popIndent();

Modified: tomcat/trunk/webapps/docs/changelog.xml
URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=1138950&r1=1138949&r2=1138950&view=diff
==============================================================================
--- tomcat/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/trunk/webapps/docs/changelog.xml Thu Jun 23 15:51:55 2011
@@ -184,6 +184,10 @@
         If you later downgrade from 7.0.17 or later to 7.0.16 or earlier, you
         must empty the work directory as part of the downgrade process. (markt)
       </fix>
+      <fix>
+        <bug>36362</bug>: Handle the case where tag file attributes (which can
+        use any valid XML name) have a name which is a Java identifier. (markt)
+      </fix>
     </changelog>
   </subsection>
   <subsection name="Cluster">



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


Mime
View raw message