Bug 11511 - Compiler 1.4 fooled by extra interface methods
Summary: Compiler 1.4 fooled by extra interface methods
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows 2000
: P2 normal (vote)
Target Milestone: 2.0 M4   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-03-16 20:40 EST by Philipe Mulet CLA
Modified: 2002-03-16 21:23 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.