Bug 264881

Summary: [1.5][compiler]Incorrect unchecked conversion warnings for return types
Product: [Eclipse Project] JDT Reporter: Kent Johnson <kent_johnson>
Component: CoreAssignee: Kent Johnson <kent_johnson>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 3.5   
Target Milestone: 3.5 M6   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
Proposed patch and testcase
none
Proposed patch and testcase none

Description Kent Johnson CLA 2009-02-13 13:40:08 EST
We currently report unchecked conversion warnings in 6 of these cases.

But the methods in C do not need a warning since A is a raw type.

class A<U extends Number> {
	<T extends Number> U a() { return null; }
	<T> T x() { return null; }
	<T extends Number> T y() { return null; }
	<T extends Integer> T z() { return null; }
}
class B extends A<Double> {
	@Override Double a() { return 1.0; }
	@Override Integer x() { return 1; }
	@Override Integer y() { return 1; }
	@Override Integer z() { return 1; }
}
class C extends A {
	@Override Double a() { return 1.0; }
	@Override Integer x() { return 1; } // incorrect
	@Override Integer y() { return 1; } // incorrect
	@Override Integer z() { return 1; } // incorrect
}
Comment 1 Kent Johnson CLA 2009-02-13 15:03:09 EST
Created attachment 125679 [details]
Proposed patch and testcase
Comment 2 Kent Johnson CLA 2009-02-13 15:28:31 EST
Created attachment 125685 [details]
Proposed patch and testcase
Comment 3 Kent Johnson CLA 2009-02-13 16:41:13 EST
Released fix and tests for 3.5M6
Comment 4 Frederic Fusier CLA 2009-03-09 13:55:20 EDT
Verified for 3.5M6 using I20090309-0100