Bug 264881 - [1.5][compiler]Incorrect unchecked conversion warnings for return types
Summary: [1.5][compiler]Incorrect unchecked conversion warnings for return types
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.5   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 3.5 M6   Edit
Assignee: Kent Johnson CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-02-13 13:40 EST by Kent Johnson CLA
Modified: 2009-03-09 13:55 EDT (History)
0 users

See Also:


Attachments
Proposed patch and testcase (10.67 KB, patch)
2009-02-13 15:03 EST, Kent Johnson CLA
no flags Details | Diff
Proposed patch and testcase (11.59 KB, patch)
2009-02-13 15:28 EST, Kent Johnson CLA
no flags Details | Diff

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