You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2021/04/07 08:09:50 UTC
[tomcat] 01/06: Remove unnecessary code. s cannot be null here
This is an automated email from the ASF dual-hosted git repository.
markt pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomcat.git
commit 28b4b98f522dfe311249193a25953abf4e7d2829
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 09e1053..ff79296 100644
--- a/java/org/apache/jasper/compiler/Generator.java
+++ b/java/org/apache/jasper/compiler/Generator.java
@@ -129,22 +129,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-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org