By puredanger
via tech.puredanger.com
Published: Jun 28 2008 / 19:15
One of the built-in annotations in Java 5 is SuppressWarnings. You can use this annotation on all the available annotation levels (class, field, method, constructor, local variable, etc) to suppress warnings that might be generated by a compiler.
Comments
cbang replied ago:
Was confused a while ago, going from compiler to compiler, so did some digging on my own as well:
http://coffeecokeandcode.blogspot.com/2008/05/suppresswarnings-annotations.html
When do we get SuppressError? Would be very handy when not catching a checked exception or when you comment out a line of code which throws an exception, and now you also have to comment out all the catch code in order to satisfy the compiler. Stupid javac, should've been an unreachable code warning instead.
Voters For This Link (8)
Voters Against This Link (0)