tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cos...@apache.org
Subject cvs commit: jakarta-tomcat/src/share/org/apache/jasper/compiler JasperMangler.java
Date Fri, 03 Aug 2001 02:39:23 GMT
costin      01/08/02 19:39:23

  Modified:    src/share/org/apache/jasper/compiler JasperMangler.java
  Log:
  2 fixes in mangler: don't allow keywords in the class name ( new.jsp ) and
  digits in the first position ( 0.jsp ).
  
  We have problems with that because we generate cleaner names, instead of a
  long string. IMHO it's worth to have a nice name.
  
  Revision  Changes    Path
  1.6       +6 -0      jakarta-tomcat/src/share/org/apache/jasper/compiler/JasperMangler.java
  
  Index: JasperMangler.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/compiler/JasperMangler.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- JasperMangler.java	2001/03/06 21:35:46	1.5
  +++ JasperMangler.java	2001/08/03 02:39:23	1.6
  @@ -170,6 +170,9 @@
   	// Fix for invalid characters. From CommandLineCompiler
   	StringBuffer modifiedClassName = new StringBuffer();
   	char c='/';
  +	if( Character.isDigit( className.charAt( 0 )  )) {
  +	    className="_" +className;
  +	}
   	for (int i = 0; i < className.length(); i++) {
   	    char prev=c;
   	    c=className.charAt(i);
  @@ -246,6 +249,9 @@
   		baseClassN=jspFile.substring( 1, extIdx );
   	}
   
  +	if( JavaGeneratorTool.isKeyword( baseClassN ) )
  +	    baseClassN="_" + baseClassN;
  +	
   	baseClassN=fixInvalidChars( baseClassN );
   	
   	//	System.out.println("XXXMangler: " + jspFile + " " +
  
  
  

Mime
View raw message