Bug 69901 - [1.5] Interface / Generic: unchecked conversion should throw a warning
Summary: [1.5] Interface / Generic: unchecked conversion should throw a warning
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.1 M1   Edit
Assignee: Kent Johnson CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-07-13 04:04 EDT by Neuhauser Bernhard CLA
Modified: 2005-01-11 11: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 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.