Bug 77496 - [1.5] compiler doesn't detect illegal method overriding due to non-matching return type parameters
Summary: [1.5] compiler doesn't detect illegal method overriding due to non-matching r...
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.1 M4   Edit
Assignee: Kent Johnson CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-11-02 12:42 EST by Markus Keller CLA
Modified: 2004-12-14 15:02 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 Markus Keller CLA 2004-11-02 12:42:04 EST
I20041101-0800 + jdt.core from HEAD

Eclipse compiles the following CU without error. javac1.5.0's errors in comments.

package p;
import java.util.List;

interface IDoubles {
	public List<Double> getList();
}


class A implements IDoubles {
	//p.A is not abstract and does not override abstract method getList()
	//in p.IDoubles
	public List<String> getList() {
		//getList() in p.A cannot implement getList() in p.IDoubles;
		//attempting to use incompatible return type
		return null;
	}
}


class B {
	public List<String> getList() {
		return null;
	}
}

class C extends B implements IDoubles {
	//p.C is not abstract and does not override abstract method getList()
	//in p.IDoubles
	void use() {
		List<String> l= getList();
	}
}
Comment 1 Kent Johnson CLA 2004-11-16 15:36:53 EST
Added GenericType test 385
Comment 2 Olivier Thomann CLA 2004-12-14 15:02:15 EST
Verified in 200412140800