We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0fc00ef commit 4760c68Copy full SHA for 4760c68
utils/src/main/java/net/objectlab/kit/util/StringUtil.java
@@ -497,14 +497,14 @@ public static String nullIfEmpty(final String txt) {
497
*/
498
public static int compareTo(final String s1, final String s2) {
499
int ret;
500
- if (s1 == null && s2 == null) {
+ if (s1 != null && s2 != null) {
501
+ ret = s1.compareTo(s2);
502
+ } else if (s1 == null && s2 == null) {
503
ret = 0;
504
} else if (s1 != null && s2 == null) {
505
ret = 1;
- } else if (s1 == null && s2 != null) {
- ret = -1;
506
} else {
507
- ret = s1.compareTo(s2);
+ ret = -1;
508
}
509
return ret;
510
0 commit comments