dev@glassfish.java.net

suggestion on _at_SuppressWarning blanket suppression

From: Lloyd L Chambers <Lloyd.Chambers_at_Sun.COM>
Date: Tue, 19 Feb 2008 10:09:46 -0800

I see classes like this that suppress warnings for the entire file,

@SuppressWarnings("unchecked")
public class MyClass {
...
}

I find this troublesome as a general approach. What about localizing
the issue to specific method(s) that qualify:

public class MyClass {
     @SuppressWarnings("unchecked")
     final ConfigBean asConfigBean( final Object o )
     {
         return (ConfigBean)o;
     }
...
}



---
Lloyd L Chambers
lloyd.chambers_at_sun.com
Sun Microsystems, Inc