Code cleanup: Remove statements with empty body
@@ -350,9 +350,8 @@ public class StringUtils {
StringBuilder out = new StringBuilder((int) (len * 1.3));
for (; i < len; i++) {
ch = input[i];
- if (ch > '>') {
- // Nothing to do
- } else if (ch == '<') {
+ if (ch <= '>') {
+ if (ch == '<') {
if (i > last) {
out.append(input, last, i - last);
}
@@ -372,6 +371,7 @@ public class StringUtils {
out.append(QUOTE_ENCODE);
}
}
+ }
if (last == 0) {
return in;
}
@@ -1272,10 +1272,8 @@ public class StringUtils {
StringBuilder out = new StringBuilder((int) (len * 1.3));
for (; i < len; i++) {
ch = input[i];
-
- if (ch > '>') {
- // Nothing to do
- } else if (ch == '<') {
+ if (ch <= '>') {
+ if (ch == '<') {
if (i > last) {
out.append(input, last, i - last);
}
@@ -1293,17 +1291,18 @@ public class StringUtils {
}
last = i + 1;
out.append(QUOTE_ENCODE);
- } else if (ch == 10 || ch == 13 || ch == 9) {
- // Nothing to do
- } else if (ch < 32) {
+ } else if (ch != 10 && ch != 13 && ch != 9) {
// Disallow all ASCII control characters, except space,
// enter characters and tabs:
+ if (ch < 32) {
if (i > last) {
out.append(input, last, i - last);
}
last = i + 1;
}
}
+ }
+ }
if (last == 0) {
// Return after escaping <![CDATA]]> end sequence "]]>"
return string.replace("]]>", "]]&amp;gt;");
