costin      01/02/11 11:27:32

  Modified:    src/share/org/apache/jasper/runtime JspWriterImpl.java
  Log:
  Fix the System.getProperty("line.separator") problem in JspWriter.
  ( it was causing most of the failures in the nightly tests for sandboxed
  tomcat ).
  
  This adds another dependency between jasper and tomcat.util ( the first is
  tomcat.util.log, now tomcat.util.compat ). Since both packages are completely
  standalone and can be bundled with jasper, I don't think it'll be a problem.
  
  ( of course, a better solution would be to have the general-purpose tools
  in a org.apache.util.{log,compat}, there is no reason to keep them in tomcat )
  
  Revision  Changes    Path
  1.5       +17 -4     
jakarta-tomcat/src/share/org/apache/jasper/runtime/JspWriterImpl.java
  
  Index: JspWriterImpl.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat/src/share/org/apache/jasper/runtime/JspWriterImpl.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- JspWriterImpl.java        2000/06/30 20:21:03     1.4
  +++ JspWriterImpl.java        2001/02/11 19:27:32     1.5
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat/src/share/org/apache/jasper/runtime/JspWriterImpl.java,v 1.4 
2000/06/30 20:21:03 costin Exp $
  - * $Revision: 1.4 $
  - * $Date: 2000/06/30 20:21:03 $
  + * $Header: 
/home/cvs/jakarta-tomcat/src/share/org/apache/jasper/runtime/JspWriterImpl.java,v 1.5 
2001/02/11 19:27:32 costin Exp $
  + * $Revision: 1.5 $
  + * $Date: 2001/02/11 19:27:32 $
    *
    * ====================================================================
    * 
  @@ -72,6 +72,7 @@
   import javax.servlet.jsp.JspWriter;
   
   import org.apache.jasper.Constants;
  +import org.apache.tomcat.util.compat.*;
   
   /**
    * Write text to a character-output stream, buffering characters so as
  @@ -382,7 +383,19 @@
       }
   
   
  -    static String lineSeparator = System.getProperty("line.separator");
  +    static String lineSeparator;
  +    static {
  +     Jdk11Compat jdk11Compat=Jdk11Compat.getJdkCompat();
  +     try {
  +         lineSeparator = (String)jdk11Compat.doPrivileged( new Action() {
  +                 public Object run() throws Exception {
  +                     return System.getProperty("line.separator");
  +                 }
  +             });
  +     } catch( Exception ex ) {
  +         lineSeparator="\r\r";
  +     }
  +    }
   
       /**
        * Write a line separator.  The line separator string is defined by the
  
  
  

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

Reply via email to