1.1 --- a/src/share/classes/com/sun/tools/javac/comp/Check.java Thu Jul 26 16:48:41 2012 -0700 1.2 +++ b/src/share/classes/com/sun/tools/javac/comp/Check.java Thu Aug 02 18:22:41 2012 +0100 1.3 @@ -426,7 +426,7 @@ 1.4 /** 1.5 * Report a check error 1.6 */ 1.7 - void report(DiagnosticPosition pos, Type found, Type req, JCDiagnostic details); 1.8 + void report(DiagnosticPosition pos, JCDiagnostic details); 1.9 /** 1.10 * Obtain a warner for this check context 1.11 */ 1.12 @@ -450,8 +450,8 @@ 1.13 return enclosingContext.compatible(found, req, warn); 1.14 } 1.15 1.16 - public void report(DiagnosticPosition pos, Type found, Type req, JCDiagnostic details) { 1.17 - enclosingContext.report(pos, found, req, details); 1.18 + public void report(DiagnosticPosition pos, JCDiagnostic details) { 1.19 + enclosingContext.report(pos, details); 1.20 } 1.21 1.22 public Warner checkWarner(DiagnosticPosition pos, Type found, Type req) { 1.23 @@ -463,12 +463,8 @@ 1.24 * Check context to be used when evaluating assignment/return statements 1.25 */ 1.26 CheckContext basicHandler = new CheckContext() { 1.27 - public void report(DiagnosticPosition pos, Type found, Type req, JCDiagnostic details) { 1.28 - if (details == null) { 1.29 - log.error(pos, "prob.found.req", found, req); 1.30 - } else { 1.31 - log.error(pos, "prob.found.req.1", details); 1.32 - } 1.33 + public void report(DiagnosticPosition pos, JCDiagnostic details) { 1.34 + log.error(pos, "prob.found.req", details); 1.35 } 1.36 public boolean compatible(Type found, Type req, Warner warn) { 1.37 return types.isAssignable(found, req, warn); 1.38 @@ -498,10 +494,10 @@ 1.39 return found; 1.40 } else { 1.41 if (found.tag <= DOUBLE && req.tag <= DOUBLE) { 1.42 - checkContext.report(pos, found, req, diags.fragment("possible.loss.of.precision")); 1.43 + checkContext.report(pos, diags.fragment("possible.loss.of.precision", found, req)); 1.44 return types.createErrorType(found); 1.45 } 1.46 - checkContext.report(pos, found, req, null); 1.47 + checkContext.report(pos, diags.fragment("inconvertible.types", found, req)); 1.48 return types.createErrorType(found); 1.49 } 1.50 } 1.51 @@ -519,7 +515,7 @@ 1.52 if (types.isCastable(found, req, castWarner(pos, found, req))) { 1.53 return req; 1.54 } else { 1.55 - checkContext.report(pos, found, req, diags.fragment("inconvertible.types", found, req)); 1.56 + checkContext.report(pos, diags.fragment("inconvertible.types", found, req)); 1.57 return types.createErrorType(found); 1.58 } 1.59 }