--- old/src/share/classes/com/sun/tools/javac/comp/Check.java 2010-07-14 01:57:39.000000000 -0700 +++ new/src/share/classes/com/sun/tools/javac/comp/Check.java 2010-07-14 01:57:39.000000000 -0700 @@ -393,6 +393,10 @@ * @param req The type that was required. */ Type checkType(DiagnosticPosition pos, Type found, Type req) { + return checkType(pos, found, req, "incompatible.types"); + } + + Type checkType(DiagnosticPosition pos, Type found, Type req, String errKey) { if (req.tag == ERROR) return req; if (found.tag == FORALL) @@ -411,7 +415,7 @@ log.error(pos, "assignment.to.extends-bound", req); return types.createErrorType(found); } - return typeError(pos, diags.fragment("incompatible.types"), found, req); + return typeError(pos, diags.fragment(errKey), found, req); } /** Instantiate polymorphic type to some prototype, unless