tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1156304 - in /tomcat/trunk/java/org/apache/jasper/compiler: DefaultErrorHandler.java ErrorDispatcher.java
Date Wed, 10 Aug 2011 18:37:56 GMT
Author: markt
Date: Wed Aug 10 18:37:56 2011
New Revision: 1156304

URL: http://svn.apache.org/viewvc?rev=1156304&view=rev
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=41673
Use platform line endings when reporting error messages

Modified:
    tomcat/trunk/java/org/apache/jasper/compiler/DefaultErrorHandler.java
    tomcat/trunk/java/org/apache/jasper/compiler/ErrorDispatcher.java

Modified: tomcat/trunk/java/org/apache/jasper/compiler/DefaultErrorHandler.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/compiler/DefaultErrorHandler.java?rev=1156304&r1=1156303&r2=1156304&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/jasper/compiler/DefaultErrorHandler.java (original)
+++ tomcat/trunk/java/org/apache/jasper/compiler/DefaultErrorHandler.java Wed Aug 10 18:37:56
2011
@@ -17,6 +17,7 @@
 
 package org.apache.jasper.compiler;
 
+import org.apache.jasper.Constants;
 import org.apache.jasper.JasperException;
 
 /**
@@ -76,24 +77,28 @@ class DefaultErrorHandler implements Err
                 args = new Object[] {
                         Integer.valueOf(details[i].getJspBeginLineNumber()), 
                         details[i].getJspFileName() };
-                buf.append("\n\n");
+                buf.append(Constants.NEWLINE);
+                buf.append(Constants.NEWLINE);
                 buf.append(Localizer.getMessage("jsp.error.single.line.number",
                         args));
-                buf.append("\n");
+                buf.append(Constants.NEWLINE);
                 buf.append(details[i].getErrorMessage());
-                buf.append("\n");
+                buf.append(Constants.NEWLINE);
                 buf.append(details[i].getJspExtract());
             } else {
                 args = new Object[] {
                         Integer.valueOf(details[i].getJavaLineNumber()) };
-                buf.append("\n\n");
+                buf.append(Constants.NEWLINE);
+                buf.append(Constants.NEWLINE);
                 buf.append(Localizer.getMessage("jsp.error.java.line.number",
                         args));
-                buf.append("\n");
+                buf.append(Constants.NEWLINE);
                 buf.append(details[i].getErrorMessage());
             }
         }
-        buf.append("\n\nStacktrace:");
+        buf.append(Constants.NEWLINE);
+        buf.append(Constants.NEWLINE);
+        buf.append("Stacktrace:");
         throw new JasperException(
                 Localizer.getMessage("jsp.error.unable.compile") + ": " + buf);
     }

Modified: tomcat/trunk/java/org/apache/jasper/compiler/ErrorDispatcher.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/compiler/ErrorDispatcher.java?rev=1156304&r1=1156303&r2=1156304&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/jasper/compiler/ErrorDispatcher.java (original)
+++ tomcat/trunk/java/org/apache/jasper/compiler/ErrorDispatcher.java Wed Aug 10 18:37:56
2011
@@ -22,6 +22,7 @@ import java.io.StringReader;
 import java.net.MalformedURLException;
 import java.util.ArrayList;
 
+import org.apache.jasper.Constants;
 import org.apache.jasper.JasperException;
 import org.apache.jasper.JspCompilationContext;
 import org.xml.sax.SAXException;
@@ -473,7 +474,7 @@ public class ErrorDispatcher {
             // Ignore messages preceding first error
             if (errMsgBuf != null) {
                 errMsgBuf.append(line);
-                errMsgBuf.append("\n");
+                errMsgBuf.append(Constants.NEWLINE);
             }
         }
         



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


Mime
View raw message