Author: markt Date: Tue Jul 7 13:17:42 2015 New Revision: 1689656 URL: http://svn.apache.org/r1689656 Log: Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=58110 Like scriptlet sections, declaration sections of JSP pages have a one-to-one mapping of lines to the generated .java file. Use this information to provide more accurate error messages if a compilation error occurs in a declaration section.
Modified: tomcat/trunk/java/org/apache/jasper/compiler/ErrorDispatcher.java 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=1689656&r1=1689655&r2=1689656&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/jasper/compiler/ErrorDispatcher.java (original) +++ tomcat/trunk/java/org/apache/jasper/compiler/ErrorDispatcher.java Tue Jul 7 13:17:42 2015 @@ -397,7 +397,8 @@ public class ErrorDispatcher { if ((errNode != null) && (errNode.getStart() != null)) { // 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) { + if (errVisitor.getJspSourceNode() instanceof Node.Scriptlet || + errVisitor.getJspSourceNode() instanceof Node.Declaration) { javacError = new JavacErrorDetail( fname, lineNum, --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org