Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » Type safety warnings when not using generics
Type safety warnings when not using generics [message #299045] Thu, 09 February 2006 08:53 Go to next message
Eclipse UserFriend
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 Go to previous message
Eclipse UserFriend
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
>
Previous Topic:dynamic javadoc window
Next Topic:how to add fonts to eclipse on linux installation ?
Goto Forum:
  


Current Time: Mon Nov 10 01:06:42 EST 2025

Powered by FUDForum. Page generated in 0.13177 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top