Using eclipse, I want to see a warning as soon as any of my used methods is marked as @Deprecated
. Method calls are correctly crossed out if so, but eclipse does not give out a warning if the method origins from the same class. See the screenshot below.
For better reproducing, I'll also provide the code in textform:
/* MainClass.java */
public class MainClass {
public static void main(String[] args) {
MainClass.foo();
MemberClass.foo();
OtherClass.foo();
}
@Deprecated
public static void foo() {
return;
}
private static class MemberClass {
@Deprecated
protected static void foo() {
return;
}
}
}
/* OtherClass.java */
public class OtherClass {
@Deprecated
public static void foo() {
return;
}
}
Whereas only OtherClass.foo()
generates a warning. Why? How can I fix this?
Enable project specific settings
is deactivatedWindow
->Preferences
->Java
->Compiler
->Errors/Warnings
->Deprecated and restricted API
if fully set toWarning
, as can be seen from the picture above.
Note: Eclipse not showing deprecated warning? is not related