JDK-7175911 : Simplify error reporting API in Check.CheckContext interface
  • Type: Sub-task
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 8
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: unknown
  • Submitted: 2012-06-11
  • Updated: 2012-12-18
  • Resolved: 2012-08-10
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8
8 b52Fixed
Related Reports
Relates :  
Description
The CheckContext interface currently defines a method for logging type mismatch that accepts the following parameters:

*) a diagnostic position
*) a found type
*) an expected type
*) a details diagnostic

The report method is used in two ways (mostly orthogonal):

1) simple type mismatch error (of the kind found/req) are reported by using the found/req parameters and by setting the diagnostic to null

2) complex mismatch errors (i.e. caused by inference failures) do not use found/req - they only rely on the diagnostic param.

CheckContext's interface for reporting errors should be simplified to only accept a diagnostic (reason as to why a type mismatch has occurred). Info about found/req types, where available, should be encapsulated inside the details diagnostic.

Comments
EVALUATION http://hg.openjdk.java.net/hsx/hotspot-comp/langtools/rev/cddc2c894cc6
14-08-2012

EVALUATION http://hg.openjdk.java.net/hsx/hotspot-main/langtools/rev/cddc2c894cc6
11-08-2012

SUGGESTED FIX A webrev of this fix is available at the following URL: http://hg.openjdk.java.net/jdk8/tl/langtools/rev/cddc2c894cc6
03-08-2012

EVALUATION This is a nice cleanup that will increase regularity in error message generation; this will be very useful when generalized support for poly expressions will be thrown into the picture.
11-06-2012