Skip to content

Commit

Permalink
Remove unnecessary code
Browse files Browse the repository at this point in the history
  • Loading branch information
markt-asf committed Jan 17, 2025
1 parent 7923e11 commit 90910c0
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions java/org/apache/el/util/Validation.java
Original file line number Diff line number Diff line change
Expand Up @@ -84,18 +84,14 @@ public static boolean isIdentifier(String key) {
}
}

// 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;
}
}

0 comments on commit 90910c0

Please sign in to comment.