Author: markt
Date: Tue Nov 19 09:08:08 2013
New Revision: 1543353

URL: http://svn.apache.org/r1543353
Log:
Fix regression introduced in r1445964.
Extract the correct lines from the JSP when displaying the error

Modified:
    tomcat/trunk/java/org/apache/jasper/compiler/JavacErrorDetail.java

Modified: tomcat/trunk/java/org/apache/jasper/compiler/JavacErrorDetail.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/compiler/JavacErrorDetail.java?rev=1543353&r1=1543352&r2=1543353&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/jasper/compiler/JavacErrorDetail.java 
(original)
+++ tomcat/trunk/java/org/apache/jasper/compiler/JavacErrorDetail.java Tue Nov 
19 09:08:08 2013
@@ -82,6 +82,8 @@ public class JavacErrorDetail {
         this.javaLineNum = javaLineNum;
         this.errMsg = errMsg;
         this.jspFileName = jspFileName;
+        // Note: this.jspBeginLineNum is set at the end of this method as it 
may
+        //       be modified (corrected) during the execution of this method
 
         if (jspBeginLineNum > 0 && ctxt != null) {
             InputStream is = null;
@@ -120,9 +122,9 @@ public class JavacErrorDetail {
 
                 // copy out a fragment of JSP to display to the user
                 StringBuilder fragment = new StringBuilder(1024);
-                int startIndex = Math.max(0, this.jspBeginLineNum-1-3);
+                int startIndex = Math.max(0, jspBeginLineNum-1-3);
                 int endIndex = Math.min(
-                        jspLines.length-1, this.jspBeginLineNum-1+3);
+                        jspLines.length-1, jspBeginLineNum-1+3);
 
                 for (int i=startIndex;i<=endIndex; ++i) {
                     fragment.append(i+1);



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

Reply via email to