BoxForComparisonInspection enhanced -> UseCompareMethodInspection

Suggests to use Integer.compare(), etc. instead if ternary operator or if chain. Fixes IDEA-173766.
This commit is contained in:
Tagir Valeev
2017-06-06 17:15:35 +07:00
parent 7bf7bb730a
commit dbcddf5a4a
16 changed files with 507 additions and 177 deletions

View File

@@ -0,0 +1,14 @@
// "Fix all ''compare()' method can be used to compare primitives' problems in file" "true"
public class Test {
public void test(int a, int b) {
if(Integer.compare(a, b) > 0) {
System.out.println(1);
}
if(Long.compare(a, b) > 0) {
System.out.println(1);
}
if(Double.compare(a, b) > 0) {
System.out.println(1);
}
}
}