JDK-6569789 : Compiler test lang/TYPE/type153/type15304/type15304.html fails since jdk7 b05
  • Type: Bug
  • Status: Closed
  • Resolution: Fixed
  • Component: tools
  • Sub-Component: javac
  • Priority: P2
  • Affected Version: 7
  • OS: generic
  • CPU: generic
  • Submit Date: 2007-06-14
  • Updated Date: 2012-03-22
  • Resolved Date: 2009-11-18
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 Availabitlity Release.

To download the current JDK release, click here.
JDK 7
7 b26Fixed
Related Reports
Relates :  
Description
JCK            : JCK-COMPILER 6a b14
J2SE           : FAIL - fail JDK 7 b05+, PASS b04, PASS jdk 6u2
Platform[s]    : FAIL - all
switch/Mode    : FAIL - default

The test lang/TYPE/type153/type15304/type15304.html fails since JDK 7 b05 with the message:
type parameters of <W>void cannot be determined; no unique maximal instance exists for type variable W with upper bounds javasoft.sqe.tests.lang.type153.type15304.C,javasoft.sqe.tests.lang.type153.type15304.I,javasoft.sqe.tests.lang.type153.type15304.I1,javasoft.sqe.tests.lang.type153.type15304.I2
        testMethod(ct);
                  ^
1 error


This problem was probably introduced by integrating CR 6192945

Comments
SUGGESTED FIX see http://sa.sfbay.sun.com/projects/langtools_data/7/6569789/
2007-12-21

EVALUATION This bug is due to the way in which javac calculates glb. When javac computes glb(T1, T2 ... Tn), basically the compiler looks for a type Tk, 1<k<n, such that Tk is a subtype of each Ti, 1<i<n. In the example however, we have that W = glb(C, I, I1, I2), so javac looks for a type which is a subtype of both C, I, I1 and I2. Unfortunately among the upper bounds of W there is not such common subtype (the situation will be different with C implementing both I, I1 and I2). So the inference fails and the compiler reports the problem. The JLS state that (5.1.10) "... where the glb(V1, V2 ... ,Vm) is the (intersection) type V1 & V2 ... & Vm. So in this case javac should infer the intersection type C&I&I1&I2 for W. As a general rule, such an intersection type should be created whenever is not possible to find a suitable common subtype among the arguments of glb.
2007-12-21