markt-asf commented on a change in pull request #331: URL: https://github.com/apache/tomcat/pull/331#discussion_r470788056
########## File path: java/org/apache/jasper/compiler/NewlineReductionServletWriter.java ########## @@ -0,0 +1,40 @@ +package org.apache.jasper.compiler; + +import java.io.PrintWriter; + +/** + * This class filters duplicate newlines instructions from the compiler output, + * and therefore from the runtime JSP. The duplicates typically happen because + * the compiler has multiple branches that write them, but they operate + * independently and don't realize that the previous output was identical. + * + * Removing these lines makes the JSP more efficient by executing fewer operations during runtime. + * + * @author Engebretson, John + * @author Kamnani, Jatin + * + */ +public class NewlineReductionServletWriter extends ServletWriter { + private static final String NEWLINE_WRITE_TEXT = "out.write('\\n');"; Review comment: There are no calls that match this pattern in the Tomcat code base. Due to this point alone, I don't see the justification for this feature. Skipping blank lines like this is going to break SMAP support. That isn't a show stopper but needs to be noted in the documentation. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org