--- old/src/share/classes/com/sun/tools/javac/code/Types.java 2013-06-07 11:19:07.811508404 -0400 +++ new/src/share/classes/com/sun/tools/javac/code/Types.java 2013-06-07 11:19:07.469505574 -0400 @@ -1317,6 +1317,23 @@ } // + /** + * Can t and s be compared for equality? Any primitive == + * primitive or primitive == object comparisons here are an error. + * Unboxing and correct primitive == primitive comparisons are + * already dealt with in Attr.visitBinary. + * + */ + public boolean isEqualityComparable(Type s, Type t, Warner warn) { + boolean tPrimitive = t.isPrimitive(); + boolean sPrimitive = s.isPrimitive(); + if (!tPrimitive && !sPrimitive) { + return isCastable(s, t, warn) || isCastable(t, s, warn); + } else { + return false; + } + } + // public boolean isCastable(Type t, Type s) { return isCastable(t, s, noWarnings);