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

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


The following commit(s) were added to refs/heads/8.5.x by this push:
     new da3c216  Remove unnecessary code
da3c216 is described below

commit da3c216bad8b8a37e97d4ae1cddb91046be1c8c2
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Thu Apr 8 14:50:53 2021 +0100

    Remove unnecessary code
    
    If an attribute is not a named attribute then it must appear in an XML
    element in the form attributeName="attributeValue". There is no way to
    construct such an XML attribute such that the attributeValue is null. I
    have also checked all the possible code paths to this method and I could
    not find any where an attribute that was not a named attribute could
    have a null value.
---
 java/org/apache/jasper/compiler/Generator.java | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/java/org/apache/jasper/compiler/Generator.java 
b/java/org/apache/jasper/compiler/Generator.java
index 37f2588..d0beebc 100644
--- a/java/org/apache/jasper/compiler/Generator.java
+++ b/java/org/apache/jasper/compiler/Generator.java
@@ -956,9 +956,6 @@ class Generator {
         private String attributeValue(Node.JspAttribute attr, boolean encode,
                 Class<?> expectedType) {
             String v = attr.getValue();
-            if (!attr.isNamedAttribute() && (v == null))
-                return "";
-
             if (attr.isExpression()) {
                 if (encode) {
                     return 
"org.apache.jasper.runtime.JspRuntimeLibrary.URLEncode(String.valueOf("

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

Reply via email to