--- old/src/share/classes/com/sun/tools/javac/comp/Attr.java 2013-05-02 22:24:30.135055415 -0400 +++ new/src/share/classes/com/sun/tools/javac/comp/Attr.java 2013-05-02 22:24:29.995054106 -0400 @@ -2973,7 +2973,8 @@ // Check that argument types of a reference ==, != are // castable to each other, (JLS???). if ((opc == ByteCodes.if_acmpeq || opc == ByteCodes.if_acmpne)) { - if (!types.isCastable(left, right, new Warner(tree.pos()))) { + if (!types.isEqualityComparable(left, right, + new Warner(tree.pos()))) { log.error(tree.pos(), "incomparable.types", left, right); } }