When I compile, javac outputs:
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.`
Two possible ways:
@SuppressWarnings("deprecation")
is not working for me, instead I've used
@SuppressWarnings("unchecked")
With Java 6, neither the @Depreated annotation, nor a comiler flag will help you here. The only solution that worked for me was to put a javadoc comment with the @deprecated (small caps) tag on the deprecated method:
/**
* @deprecated overriding deprecated method
*/
@Override
public javax.xml.bind.Validator createValidator() throws JAXBException {...}
(The example is from a class that derives from JAXBContext.)
(I didn't import the deprecated Validator class to avoid a warning on the import statement.)