JDK-7154127 : Inference cleanup: remove bound check analysis from visitors in Types.java
  • Type: Sub-task
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 8
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: unknown
  • Submitted: 2012-03-15
  • Updated: 2017-05-17
  • Resolved: 2012-04-26
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 b36Fixed
Description
In the JDK 7 compiler implementation, we have that inference variables are represented by a special class named UndetVar. Those types are used in subtyping/type-equality/type-containment check, and those routine actively append constraints to the inference variables.

The bad news is that in some places we go even further, and we check well-formedness w.r.t. bounds in the middle of a subtyping check. This makes it very difficult to isolate the inference/bound checking logic, so that it is harder to maintain update.

Comments
SUGGESTED FIX A webrev of this fix is available at the following URL: http://hg.openjdk.java.net/jdk8/tl/langtools/rev/6f0ed5a89c25
11-04-2012

EVALUATION We should cleanup visitors in Types.java. It is ok to set additional constraints on inference variables based on subtyping-check - but we should separate the constraint generation phase from the well-formedness check phase.
15-03-2012