Suppressing Compile Warnings with Java Annotations


If you’ve used Java 1.5 Generics much then you’re probably familiar with the following compile warning: “Type safety: The expression of type List needs unchecked conversion to conform to List<String>” or similar. It turns out there’s a rather simple solution with annotations to ignore this problem: @SuppressWarnings(“unchecked”) A couple other possible uses of the annotation Read More