Bug 21682

Summary: marking a method deprecated doesn't eleminate deprecated warning
Product: [Eclipse Project] JDT Reporter: Ilja Preuss <preuss>
Component: CoreAssignee: Philipe Mulet <philippe_mulet>
Status: RESOLVED WONTFIX QA Contact:
Severity: normal    
Priority: P3    
Version: 2.0   
Target Milestone: 2.0.1   
Hardware: PC   
OS: Windows 2000   
Whiteboard:

Description Ilja Preuss CLA 2002-07-18 06:11:56 EDT
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.
Comment 1 Philipe Mulet CLA 2002-07-18 08:12:08 EDT
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).