tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper JspC.java
Date Sun, 12 Sep 2004 21:59:41 GMT
markt       2004/09/12 14:59:41

  Modified:    jasper2/src/share/org/apache/jasper Tag: tomcat_4_branch
                        JspC.java
  Log:
  Fix bug 26400. Generate valid package names with JspC.
   - Based on a patch provided by Rainer Jung
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.12.2.11 +8 -0      jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/JspC.java
  
  Index: JspC.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/JspC.java,v
  retrieving revision 1.12.2.10
  retrieving revision 1.12.2.11
  diff -u -r1.12.2.10 -r1.12.2.11
  --- JspC.java	26 Aug 2004 18:25:53 -0000	1.12.2.10
  +++ JspC.java	12 Sep 2004 21:59:40 -0000	1.12.2.11
  @@ -945,10 +945,16 @@
           int iSep = jspUri.lastIndexOf('/');
           // Start after the first slash
           int nameStart = 1;
  +        boolean isFirstIdentifierChar = true;
           for (int i = 1; i < iSep; i++) {
               char ch = jspUri.charAt(i);
               if (Character.isJavaIdentifierPart(ch)) {
  +                if ( isFirstIdentifierChar
  +                        && ( !Character.isJavaIdentifierStart(ch)) ) {
  +                    modifiedPackageName.append('_');
  +                }
                   modifiedPackageName.append(ch);
  +                isFirstIdentifierChar = false;
               }
               else if (ch == '/') {
                   if (isJavaKeyword(jspUri.substring(nameStart, i))) {
  @@ -956,8 +962,10 @@
                   }
                   nameStart = i+1;
                   modifiedPackageName.append('.');
  +                isFirstIdentifierChar = true;
               } else {
                   modifiedPackageName.append(mangleChar(ch));
  +                isFirstIdentifierChar = false;
               }
           }
           if (nameStart < iSep && isJavaKeyword(jspUri.substring(nameStart, iSep)))
{
  
  
  

---------------------------------------------------------------------
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