Community
Participate
Working Groups
Consider the following two classes: public class Foo { /** @deprecated */ public static String foo; } public class Bar { /** @deprecated */ public void bar() { System.out.println(Foo.foo); } } The compiler shows a deprecated warning for the usage of Foo.foo in Bar.bar(), even though Bar.bar() itself is marked deprecated, which should eleminate the warning.
The fact it is deprecated itself doesn't give it more permission to invoke deprecated members. javac issues the same warning: p\Bar.java:6: warning: foo in p.Foo has been deprecated System.out.println(Foo.foo); ^ 1 warning (javac only issues deprecation warnings for files compiled separately, so you need to compile the 2 files in 2 steps to see it).