@SuppressWarnings("deprecation") is not suppressing warnings when I compile the below code on SDK 1.6.0. This code is copied straight from the Java Tutorial page at http://java.sun.com/docs/books/tutorial/java/javaOO/QandE/annotations-answers.html
Any hints would be appreciated.
Thank you,
Andrew Bloss
public class MyHouse implements House {
@SuppressWarnings("deprecation")
public void open() {}
public void openFrontDoor() {}
public void openBackDoor() {}
}
I get the message
"MyHouse.java uses or overrides a deprecated API."
I copied both the interface and the code from the tutorial page. The message does appear if I replace
@SuppressWarnings("deprecation")
with
@Deprecated
.
The interfac is
public interface House {
/**
* @deprecated use of open is discouraged, use
* openFrontDoor or openBackDoor instead.
*/
@Deprecated
public void open();
public void openFrontDoor();
public void openBackDoor();
}