tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kkoli...@apache.org
Subject svn commit: r1142043 - in /tomcat/trunk/java/org/apache/jasper/compiler: Generator.java JspUtil.java
Date Fri, 01 Jul 2011 19:46:00 GMT
Author: kkolinko
Date: Fri Jul  1 19:46:00 2011
New Revision: 1142043

URL: http://svn.apache.org/viewvc?rev=1142043&view=rev
Log:
Followup to r1140693
Declare a separate public method for the new use case of makeJavaIdentifier(),
instead of passing the "false" flag as an argument.

Modified:
    tomcat/trunk/java/org/apache/jasper/compiler/Generator.java
    tomcat/trunk/java/org/apache/jasper/compiler/JspUtil.java

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=1142043&r1=1142042&r2=1142043&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/jasper/compiler/Generator.java (original)
+++ tomcat/trunk/java/org/apache/jasper/compiler/Generator.java Fri Jul  1 19:46:00 2011
@@ -3675,8 +3675,8 @@ class Generator {
                 out.print(JspUtil.toJavaSourceType(attrInfos[i].getTypeName()));
                 out.print(" ");
             }
-            out.print(JspUtil.makeJavaIdentifier(
-                    attrInfos[i].getName(), false));
+            out.print(JspUtil.makeJavaIdentifierForAttribute(
+                    attrInfos[i].getName()));
             out.println(";");
         }
         out.println();
@@ -3684,7 +3684,7 @@ class Generator {
         // Define attribute getter and setter methods
         for (int i = 0; i < attrInfos.length; i++) {
             String javaName =
-                JspUtil.makeJavaIdentifier(attrInfos[i].getName(), false);
+                JspUtil.makeJavaIdentifierForAttribute(attrInfos[i].getName());
 
             // getter method
             out.printin("public ");

Modified: tomcat/trunk/java/org/apache/jasper/compiler/JspUtil.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/compiler/JspUtil.java?rev=1142043&r1=1142042&r2=1142043&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/jasper/compiler/JspUtil.java (original)
+++ tomcat/trunk/java/org/apache/jasper/compiler/JspUtil.java Fri Jul  1 19:46:00 2011
@@ -806,7 +806,20 @@ public class JspUtil {
     public static final String makeJavaIdentifier(String identifier) {
         return makeJavaIdentifier(identifier, true);
     }
-    
+
+    /**
+     * Converts the given identifier to a legal Java identifier
+     * to be used for JSP Tag file attribute names. 
+     * 
+     * @param identifier
+     *            Identifier to convert
+     * 
+     * @return Legal Java identifier corresponding to the given identifier
+     */
+    public static final String makeJavaIdentifierForAttribute(String identifier) {
+        return makeJavaIdentifier(identifier, false);
+    }
+
     /**
      * Converts the given identifier to a legal Java identifier.
      * 
@@ -815,7 +828,7 @@ public class JspUtil {
      * 
      * @return Legal Java identifier corresponding to the given identifier
      */
-    public static final String makeJavaIdentifier(String identifier,
+    private static final String makeJavaIdentifier(String identifier,
             boolean periodToUnderscore) {
         StringBuilder modifiedIdentifier = new StringBuilder(identifier.length());
         if (!Character.isJavaIdentifierStart(identifier.charAt(0))) {



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


Mime
View raw message