IDEA-171854 Suggest replacing boxed compareTo with convenience methods from Java 7

This commit is contained in:
Tagir Valeev
2017-04-24 17:41:21 +07:00
parent 7bd221e166
commit 54eb5b2d2b
8 changed files with 257 additions and 0 deletions
@@ -0,0 +1,14 @@
// "Fix all 'Unnecessary boxing 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);
}
}
}