mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-05-01 10:48:09 +07:00
Suggests to use Integer.compare(), etc. instead if ternary operator or if chain. Fixes IDEA-173766.
16 lines
455 B
Java
16 lines
455 B
Java
// "Fix all ''compare()' method can be used to compare primitives' problems in file" "true"
|
|
class Test {
|
|
public void test(String s1, String s2) {
|
|
int res;
|
|
res = Integer.compare(s2.length(), s1.length())
|
|
System.out.println(res);
|
|
}
|
|
|
|
public void testMissingElse(String s1, String s2) {
|
|
int res;
|
|
if(s1.length() < s2.length()) res = 1;
|
|
else if(s1.length() > s2.length()) res = -1;
|
|
res = 0;
|
|
System.out.println(res);
|
|
}
|
|
} |