| Type safety warnings when not using generics [message #299045] |
Thu, 09 February 2006 08:53  |
Eclipse User |
|
|
|
Originally posted by: giftwrapuk.yahoo.co.uk
Hi,
since I switches to Java 1.5 my problems view is cluttered with warnings
like "Type safety: the method xy belongs to the raw type Map, references
to generic type Map<K,V> should be parameterized". However, I cannot
switch all of the code to generics at once and the warnings just get in
the way when I'm looking for real problems. I can't figure out how to turn
those warnings off, though. At
window/preferences/java/compiler/warnings/j2se5.0 options the only
warnings I have turned on are:
- generic type parameter declared with a final type bound
- inexact type match for varargs
- annotation used as super interface
- not all enums covered in switch
- unhandled warning tokens in @suppresswarnings
None of those options is about this generic problem. Does anybody know how
to turn off this warning type? Thanks a lot!
Torsten
|
|
|
| Re: Type safety warnings when not using generics [message #299060 is a reply to message #299045] |
Thu, 09 February 2006 10:53  |
Eclipse User |
|
|
|
Originally posted by: kwpeck.mersoft.com
At the bottom of the filter dialog you can do
Where descriptions [does not contain] [Type Safety]
Or you can go in your code and add
@SuppressWarnings("unchecked")
over the class name or method name of the ones you want to ignore for now
Torsten wrote:
> Hi,
> since I switches to Java 1.5 my problems view is cluttered with warnings
> like "Type safety: the method xy belongs to the raw type Map, references
> to generic type Map<K,V> should be parameterized". However, I cannot
> switch all of the code to generics at once and the warnings just get in
> the way when I'm looking for real problems. I can't figure out how to
> turn those warnings off, though. At
> window/preferences/java/compiler/warnings/j2se5.0 options the only
> warnings I have turned on are: - generic type parameter declared with a
> final type bound
> - inexact type match for varargs
> - annotation used as super interface
> - not all enums covered in switch
> - unhandled warning tokens in @suppresswarnings
>
> None of those options is about this generic problem. Does anybody know
> how to turn off this warning type? Thanks a lot!
> Torsten
>
|
|
|
Powered by
FUDForum. Page generated in 0.13177 seconds