Bug 69901

Summary: [1.5] Interface / Generic: unchecked conversion should throw a warning
Product: [Eclipse Project] JDT Reporter: Neuhauser Bernhard <cybernd>
Component: CoreAssignee: Kent Johnson <kent_johnson>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 3.0   
Target Milestone: 3.1 M1   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Neuhauser Bernhard CLA 2004-07-13 04:04:18 EDT
Example:

Interface ISomething {
 public Class<? extends MyClass> getSomething();
}

Implemention:
Demo implements ISomething {
 public Class getSomething(){ return .... }
}

I think, a warning should appear when you try to remove the Generic Type.

javac -XLint:

warning: getSomething() in Demo implements getSomething() in ISomething; return
type requires unchecked conversion
found: java.lang.Class
required: java.lang.Class<? extends MyClass>

hth
cybi
Comment 1 Philipe Mulet CLA 2004-07-20 10:56:04 EDT
This is work for the method verifier.
Comment 2 Kent Johnson CLA 2004-08-06 13:14:25 EDT
Fixed in HEAD & added test 279.