mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-30 10:20:15 +07:00
BoxForComparisonInspection enhanced -> UseCompareMethodInspection
Suggests to use Integer.compare(), etc. instead if ternary operator or if chain. Fixes IDEA-173766.
This commit is contained in:
@@ -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)a).compa<caret>reTo(b) > 0) {
|
||||
System.out.println(1);
|
||||
}
|
||||
if(Long.valueOf(a).compareTo(Long.valueOf(b)) > 0) {
|
||||
System.out.println(1);
|
||||
}
|
||||
if(new Double(a).compareTo(new Double(b)) > 0) {
|
||||
System.out.println(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user