This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/master by this push:
     new adcc949  Remove unnecessary code
adcc949 is described below

commit adcc9495fe0158dbac72b81f5c4c6da95e9974ee
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Thu Apr 8 15:50:25 2021 +0100

    Remove unnecessary code
    
    Node.ELExpression instances are not created if pageInfo.isELIgnored is
    true. It seems likely this code predates the refactoring (many years
    ago) that switched to parsing in two passes. The first pass parses just
    the directives. The second parses everything given on the basis of the
    directives found in the first pass.
---
 java/org/apache/jasper/compiler/Generator.java | 16 ++++++----------
 1 file changed, 6 insertions(+), 10 deletions(-)

diff --git a/java/org/apache/jasper/compiler/Generator.java 
b/java/org/apache/jasper/compiler/Generator.java
index 44227d5..e8ffe88 100644
--- a/java/org/apache/jasper/compiler/Generator.java
+++ b/java/org/apache/jasper/compiler/Generator.java
@@ -1051,16 +1051,12 @@ class Generator {
         @Override
         public void visit(Node.ELExpression n) throws JasperException {
             n.setBeginJavaLine(out.getJavaLine());
-            if (!pageInfo.isELIgnored() && (n.getEL() != null)) {
-                out.printil("out.write("
-                        + elInterpreter.interpreterCall(ctxt, this.isTagFile,
-                                n.getType() + "{" + n.getText() + "}",
-                                String.class, n.getEL().getMapName()) +
-                        ");");
-            } else {
-                out.printil("out.write("
-                        + quote(n.getType() + "{" + n.getText() + "}") + ");");
-            }
+            System.out.println("[" + pageInfo.isELIgnored() + "] [" + 
n.getEL() + "]");
+            out.printil("out.write("
+                    + elInterpreter.interpreterCall(ctxt, this.isTagFile,
+                            n.getType() + "{" + n.getText() + "}",
+                            String.class, n.getEL().getMapName()) +
+                    ");");
             n.setEndJavaLine(out.getJavaLine());
         }
 

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

Reply via email to