Skip to content

Commit 7d4596d

Browse files
committed
Merged if statements
1 parent 3a8eddb commit 7d4596d

File tree

1 file changed

+5
-14
lines changed

1 file changed

+5
-14
lines changed

src/main/java/org/utplsql/maven/plugin/util/StringUtil.java

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,27 +6,18 @@ private StringUtil() {
66
}
77

88
public static boolean isEmpty(CharSequence cs) {
9-
if (cs == null) {
10-
return true;
11-
}
12-
if (cs.length() == 0) {
13-
return true;
14-
}
15-
return false;
9+
return cs == null || cs.length() == 0;
1610
}
1711

1812
public static boolean isNotEmpty(CharSequence cs) {
1913
return !isEmpty(cs);
2014
}
2115

2216
public static boolean isBlank(CharSequence cs) {
23-
int strLen;
24-
if (cs != null) {
25-
if ((strLen = cs.length()) != 0) {
26-
for (int i = 0; i < strLen; ++i) {
27-
if (!Character.isWhitespace(cs.charAt(i))) {
28-
return false;
29-
}
17+
if (cs != null && cs.length() > 0) {
18+
for (int i = 0; i < cs.length(); ++i) {
19+
if (!Character.isWhitespace(cs.charAt(i))) {
20+
return false;
3021
}
3122
}
3223
}

0 commit comments

Comments
 (0)