Files
openide/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/useCompareMethod/afterBox.java
Tagir Valeev dbcddf5a4a BoxForComparisonInspection enhanced -> UseCompareMethodInspection
Suggests to use Integer.compare(), etc. instead if ternary operator or if chain. Fixes IDEA-173766.
2017-06-06 17:20:08 +07:00

14 lines
361 B
Java

// "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);
}
}
}