This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/main by this push: new 63e7d347ca Remove unnecessary code 63e7d347ca is described below commit 63e7d347ca2172916fc3087ac7415c992dc6b86e 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 dbb185d3c6..498c9dda7d 100644 --- a/java/org/apache/el/util/Validation.java +++ b/java/org/apache/el/util/Validation.java @@ -72,18 +72,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