IDEA-86945 'Redundant type cast' and 'Constant conditions & exceptions' inspections

This commit is contained in:
peter
2012-06-19 18:41:10 +02:00
parent f54bfe021c
commit 96d18fe897
3 changed files with 17 additions and 0 deletions
@@ -0,0 +1,11 @@
class Foo {
public void foo() {
Integer a = 128;
Integer b = (int) a;// cast is necessary because new object is created
Integer c = 128;
System.out.println(a == b);
System.out.println(<warning descr="Condition 'a == c' is always 'false'">a == c</warning>);
}
}