--- old/src/share/classes/com/sun/tools/javac/comp/Attr.java 2013-05-29 15:45:31.847249116 -0400 +++ new/src/share/classes/com/sun/tools/javac/comp/Attr.java 2013-05-29 15:45:31.721248068 -0400 @@ -3020,7 +3020,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); } }