Community
Participate
Working Groups
I'm a bit puzzled why an implementation of a deprecated method (of a non-deprecated inteface) isn't flagged as deprecated - it isn't flagged by javac either, until another method actually uses the deprecated method. I would consider an implementation a use, but then Sun may not agree. Anyway, I'd really like the editor to update the method, e.g. with a strikethrough (default behaviour) or some other marker, lightbulb/warning. Build id: I20050627-1435
I am not sure if I understand your request. Can you please provide an example.
Here's a short example: 2 java files: StuffDoer and DoStuff (Stupid names but this IS an example) public interface StuffDoer { /** * Does stuff *@deprecated this method is discouraged due to ... use manipulate(Object) instead */ void doStuff(); /** * manipulate a given object * @param target */ void manipulate(Object target); } public class DoStuff implements StuffDoer { /* (non-Javadoc) * @see StuffDoer#doStuff() */ public void doStuff() { System.out.println("doing stuff"); } /* (non-Javadoc) * @see StuffDoer#manipulate(java.lang.Object) */ public void manipulate(Object target) { System.out.println("manipulating "+target); } } When the StuffDoer.doStuff() method is deprecated I'd really appreciate knowing this has happened when I'm tampering with the DoStuff class. The example is really too small. It should encompass more developers, someone modifying the interface, someone else modifying the class, and a third actually using the modified interface (he'll know the method is deprecated due to a compile warning). If you're not aware, that someone has deprecated the method you're implementing or perhaps the programmer using the interface wonders why you've deprecated his favorite method, when in truth you're unaware that the interface responsible programmer did it - but not why. Then again, it might just be me, but I really don't see why an interface doesn't propagate method annotations in that way. If you make a 3rd file: Work.java public class Work { public static void main(String[] args) { StuffDoer sf = new DoStuff(); // reference is interface DoStuff ds = new DoStuff(); // reference is specific class sf.doStuff(); // this is deprecated ds.doStuff(); // this should be deprecated } } you'll see that sf.doStuff() is deprecated because the interface method is deprecated. Using the specific class - which is frowned upon - circumvents this real warning. In my mind, the method with that specific signature in a class implementing an interface should inherit that specific annotation. You'd really like people implementing java.lang.Runnable to quit implementing stop() or at least let them know one way or another that it's deprecated. HTH.
Moving to JDT/Core.