ecarmich    2003/09/15 06:43:54

  Modified:    jasper2/src/share/org/apache/jasper/compiler Generator.java
  Log:
  Fix SMAPping for small text strings with genStrAsCharArray=false
  
  Revision  Changes    Path
  1.207     +18 -18    
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.206
  retrieving revision 1.207
  diff -u -r1.206 -r1.207
  --- Generator.java    10 Sep 2003 23:11:56 -0000      1.206
  +++ Generator.java    15 Sep 2003 13:43:54 -0000      1.207
  @@ -1867,22 +1867,22 @@
                   return;
               }
   
  -            if (textSize <= 3) {
  -                // Spcial case small text strings
  -                n.setBeginJavaLine(out.getJavaLine());
  -                out.printil("out.write(" + quote(text.charAt(0)) + ");");
  -                if (textSize > 1) {
  -                    out.printil("out.write(" + quote(text.charAt(1)) + ");");
  -                }
  -                if (textSize > 2) {
  -                    out.printil("out.write(" + quote(text.charAt(2)) + ");");
  -                }
  -                n.setEndJavaLine(out.getJavaLine());
  -                return;
  -            }
  -
               if (ctxt.getOptions().genStringAsCharArray()) {
  -                // Generate Strings as char arrays, for performance
  +                if (textSize <= 3) {
  +                   // Spcial case small text strings
  +                   n.setBeginJavaLine(out.getJavaLine());
  +                   out.printil("out.write(" + quote(text.charAt(0)) + ");");
  +                   if (textSize > 1) {
  +                       out.printil("out.write(" + quote(text.charAt(1)) + ");");
  +                   }
  +                   if (textSize > 2) {
  +                       out.printil("out.write(" + quote(text.charAt(2)) + ");");
  +                   }
  +                   n.setEndJavaLine(out.getJavaLine());
  +                   return;
  +               }
  +
  +               // Generate Strings as char arrays, for performance
                   ServletWriter caOut;
                   if (charArrayBuffer == null) {
                       charArrayBuffer = new GenBuffer(null);
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to