tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject svn commit: r600660 - in /tomcat/tc6.0.x/trunk: STATUS.txt java/org/apache/jasper/compiler/ErrorDispatcher.java
Date Mon, 03 Dec 2007 20:17:12 GMT
Author: jim
Date: Mon Dec  3 12:17:03 2007
New Revision: 600660

URL: http://svn.apache.org/viewvc?rev=600660&view=rev
Log:
Merge r599605 from trunk:

Fix bug 43757. Rather than use string matching to work out the line in the JSP with the error,
use the SMAP info and the knowledge that for a scriptlet there is a one to one line mapping.
Submitted by: markt
Reviewed by: jim

Modified:
    tomcat/tc6.0.x/trunk/STATUS.txt
    tomcat/tc6.0.x/trunk/java/org/apache/jasper/compiler/ErrorDispatcher.java

Modified: tomcat/tc6.0.x/trunk/STATUS.txt
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/STATUS.txt?rev=600660&r1=600659&r2=600660&view=diff
==============================================================================
--- tomcat/tc6.0.x/trunk/STATUS.txt (original)
+++ tomcat/tc6.0.x/trunk/STATUS.txt Mon Dec  3 12:17:03 2007
@@ -31,12 +31,6 @@
   +1: jfclere
   -1: fhanik - Can we add the 'package' directive to make the package match the dir structure
 
-* Fix http://issues.apache.org/bugzilla/show_bug.cgi?id=43757
-  Use SMAP info rather than string matching to ID line number in JSP
-  http://svn.apache.org/viewvc?rev=599605&view=rev
-  +1: markt, funkman, pero, remm
-  -1:
-
 * Fix http://issues.apache.org/bugzilla/show_bug.cgi?id=43622
   Don't always overwrite min compression size with default
   http://svn.apache.org/viewvc?rev=599914&view=rev

Modified: tomcat/tc6.0.x/trunk/java/org/apache/jasper/compiler/ErrorDispatcher.java
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/jasper/compiler/ErrorDispatcher.java?rev=600660&r1=600659&r2=600660&view=diff
==============================================================================
--- tomcat/tc6.0.x/trunk/java/org/apache/jasper/compiler/ErrorDispatcher.java (original)
+++ tomcat/tc6.0.x/trunk/java/org/apache/jasper/compiler/ErrorDispatcher.java Mon Dec  3 12:17:03
2007
@@ -527,13 +527,26 @@
         page.visit(errVisitor);
         Node errNode = errVisitor.getJspSourceNode();
         if ((errNode != null) && (errNode.getStart() != null)) {
-            javacError = new JavacErrorDetail(
-                    fname,
-                    lineNum,
-                    errNode.getStart().getFile(),
-                    errNode.getStart().getLineNumber(),
-                    errMsgBuf,
-                    ctxt);
+            // If this is a scriplet node then there is a one to one mapping
+            // between JSP lines and Java lines
+            if (errVisitor.getJspSourceNode() instanceof Node.Scriptlet) {
+                javacError = new JavacErrorDetail(
+                        fname,
+                        lineNum,
+                        errNode.getStart().getFile(),
+                        errNode.getStart().getLineNumber() + lineNum -
+                            errVisitor.getJspSourceNode().getBeginJavaLine(),
+                        errMsgBuf,
+                        ctxt);
+            } else {
+                javacError = new JavacErrorDetail(
+                        fname,
+                        lineNum,
+                        errNode.getStart().getFile(),
+                        errNode.getStart().getLineNumber(),
+                        errMsgBuf,
+                        ctxt);
+            }
         } else {
             /*
              * javac error line number cannot be mapped to JSP page



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


Mime
View raw message