Community
Participate
Working Groups
3.0 when two expressions of types that are not cast-compatible are compared by == _the only_ way for them to be identical is that they are both null. so code like that uses == to compare a String with an Integer is almost certainly buggy. it would be nice to have a warning for that
This is already flagged as an error, since by JLS operands have to be cast compatible. public class X { public static void main(String[] args) { String s = "aaa"; Integer i = new Integer(0); if (s == i) {} // incompatible types } }
silly me - sumbitted a bug without checking first sory and thanks