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

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


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

commit 043942cec8a43caa854faef0419b455a66f42e8b
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Fri Jan 17 19:12:45 2025 +0000

    Remove unnecessary code
---
 java/org/apache/el/util/Validation.java | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/java/org/apache/el/util/Validation.java 
b/java/org/apache/el/util/Validation.java
index 9fbf30e21c..a1e4911189 100644
--- a/java/org/apache/el/util/Validation.java
+++ b/java/org/apache/el/util/Validation.java
@@ -87,18 +87,14 @@ public class Validation {
             }
         }
 
-        // Check the start character that has more restrictions
-        if (!Character.isJavaIdentifierStart(key.charAt(0))) {
+        /*
+         * The parser checks Character.isJavaIdentifierStart() and 
Character.isJavaIdentifierPart() so no need to check
+         * them again here. However, we do need to check that '#' hasn't been 
used at the start of the identifier.
+         */
+        if (key.charAt(0) == '#') {
             return false;
         }
 
-        // Check each remaining character used is permitted
-        for (int idx = 1; idx < key.length(); idx++) {
-            if (!Character.isJavaIdentifierPart(key.charAt(idx))) {
-                return false;
-            }
-        }
-
         return true;
     }
 }


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

Reply via email to