United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
JDK-7141852 : 1.6 v30 no longer compiles particular interface inheritance hierarchy

Details
Type:
Bug
Submit Date:
2012-02-01
Status:
Closed
Updated Date:
2012-07-04
Project Name:
JDK
Resolved Date:
2012-07-04
Component:
tools
OS:
windows_7
Sub-Component:
javac
CPU:
x86
Priority:
P3
Resolution:
Fixed
Affected Versions:
6u29
Fixed Versions:
6u34 (b01)

Related Reports

Sub Tasks

Description
FULL PRODUCT VERSION :
java version "1.6.0_30"
Java(TM) SE Runtime Environment (build 1.6.0_30-b12)
Java HotSpot(TM) Client VM (build 20.5-b03, mixed mode, sharing)

ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows [Version 6.1.7600]

A DESCRIPTION OF THE PROBLEM :
I have a java interface hierarchy that compiled prior to 1.6v30, and it no longer compiles.

REGRESSION.  Last worked in version 6u29

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
I have a small set of interfaces to reproduce the problem

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
  To compile successfully
ACTUAL -
reference to getObject is ambiguous, both method getObject() in test.jcb.TestInterface3b and method getObject() in test.jcb.TestInterface3b match

ERROR MESSAGES/STACK TRACES THAT OCCUR :
reference to getObject is ambiguous, both method getObject() in test.jcb.TestInterface3b and method getObject() in test.jcb.TestInterface3b match

REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
I have source, but it is several interfaces.  Not sure how to attach it:

public interface RetInterface1{}
public interface RetInterface2 extends RetInterface1 {}
public interface TestInterface extends TestInterface1a, TestInterface2a, TestInterface3a{}
public interface TestInterface1a extends TestInterface1b{}
public interface TestInterface1b extends TestInterface1c
{
    RetInterface2 getObject();
}
public interface TestInterface1c
{
    RetInterface1 getObject();
}
public interface TestInterface2a extends TestInterface1b, TestInterface2b, TestInterface3b{}
public interface TestInterface2b extends TestInterface3c   // if you comment out this extends, it compiles fine
{
}
public interface TestInterface3a extends TestInterface3b{}
public interface TestInterface3b extends TestInterface3c
{
    RetInterface2 getObject();
}
public interface TestInterface3c
{
    RetInterface1 getObject();
}
public class TestClass
{
    public static void main(String[] args)
    {
        TestInterface testIntf = new TestInterface()
        {
            public RetInterface2 getObject()
            {
                return null;
            }
        };

        testIntf.getObject();
    }
}
---------- END SOURCE ----------

CUSTOMER SUBMITTED WORKAROUND :
No work around

                                    

Comments
EVALUATION

It's a consequence of porting 7024568 w/o porting other changes it relies on. Need to port 6487370 as well or revert back 7024568 (preferably).
                                     
2012-03-15
EVALUATION

Resolve.MostSpecific erroneously depends on the order in which applicable methods are visited.
                                     
2012-05-11



Hardware and Software, Engineered to Work Together