Bug 11511

Summary: Compiler 1.4 fooled by extra interface methods
Product: [Eclipse Project] JDT Reporter: Philipe Mulet <philippe_mulet>
Component: CoreAssignee: Philipe Mulet <philippe_mulet>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P2    
Version: 2.0   
Target Milestone: 2.0 M4   
Hardware: PC   
OS: Windows 2000   
Whiteboard:

Description Philipe Mulet CLA 2002-03-16 20:40:22 EST
Build 20020314

The following code should compile clear, and currently is rejected by the 
compiler when toggled in 1.4 mode.

[package p1;

public class X extends AbstractY {

	public void init(){
		super.init();
	}
	
	public static void main(String[] arguments) {
		new X().init();
	}
}

abstract class AbstractY extends AbstractZ implements I {
	public void init(int i){
		System.out.println("SUCCESS");
	}
}

abstract class AbstractZ implements I {
	public void init(){}
}

interface I {
	void init();
	void init(int i);
}]
Comment 1 Philipe Mulet CLA 2002-03-16 20:41:45 EST
This is due to the lookup algorithm for inserting interface methods. These get 
inserted before concrete methods, and thus the tie-breaking code gets into 
trouble.

Should always add interface methods after superclass ones.
Comment 2 Philipe Mulet CLA 2002-03-16 21:23:27 EST
Fixed, regression test added.