This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch 9.0.x in repository https://gitbox.apache.org/repos/asf/tomcat.git
commit 41fe83f3605a42c614fb557567efc273ec72bc45 Author: Mark Thomas <ma...@apache.org> AuthorDate: Wed Mar 31 09:17:41 2021 +0100 Remove unnecessary code. s cannot be null here --- java/org/apache/jasper/compiler/Generator.java | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/java/org/apache/jasper/compiler/Generator.java b/java/org/apache/jasper/compiler/Generator.java index 396cd91..5f9df54 100644 --- a/java/org/apache/jasper/compiler/Generator.java +++ b/java/org/apache/jasper/compiler/Generator.java @@ -145,22 +145,20 @@ class Generator { */ static String quote(String s) { - if (s == null) + if (s == null) { return "null"; + } return '"' + escape(s) + '"'; } /** - * @param s - * the input string + * @param s the input string - must not be {@code null} + * * @return escaped string, per Java rule */ static String escape(String s) { - if (s == null) - return ""; - StringBuilder b = new StringBuilder(); for (int i = 0; i < s.length(); i++) { char c = s.charAt(i); --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org