Bug 41488 - Compiler warning for overridden deprecated method should not occur if implementing interface
Summary: Compiler warning for overridden deprecated method should not occur if impleme...
Status: RESOLVED WONTFIX
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.1.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.0 M4   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 41567 (view as bug list)
Depends on:
Blocks:
 
Reported: 2003-08-13 11:27 EDT by John P. A. Verhaeg CLA
Modified: 2015-02-10 08:52 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John P. A. Verhaeg CLA 2003-08-13 11:27:16 EDT
The compiler needs to make a distinction between implemented methods and 
overridden methods regarding the "overrides a deprecated method" warning.  The 
warning should not be generated when a deprecated method for a non-deprecated 
interface is being implemented, and no concrete implementation is actually 
overridden (For example, providing an implementation of java.sql.ResultSet for 
testing).
Comment 1 Philipe Mulet CLA 2003-08-28 12:56:53 EDT
*** Bug 41567 has been marked as a duplicate of this bug. ***
Comment 2 Philipe Mulet CLA 2003-08-28 12:57:45 EDT
The trick is to tag the implementation as deprecated itself, then we will no 
complaint (when complain in deprecated code is turned off).
Comment 3 John P. A. Verhaeg CLA 2003-08-29 08:55:00 EDT
That only works if the implementation is not intended to be used by anyone 
else, but just for something like, as in my example, testing.  If the 
implementation is meant to be used within an application, marking it as 
deprecated will most likely cause it not to be used at all, and result in 
questions from other developers as to where the correct implementation is.
Comment 4 John P. A. Verhaeg CLA 2003-08-29 09:40:42 EDT
I just tried the trick you suggested, and this doesn't work either.  Now I get 
a slew of warnings about both the type and the constructor being deprecated.  
This is happening with the "Signal use of deprecated API inside deprecated 
code" compiler preference unchecked.
Comment 5 Philipe Mulet CLA 2003-08-29 10:14:49 EDT
Responding to comment #3, I would say that it is probably a good idea to carry 
the deprecation tag anyway on the implementation, since this is useful 
information to retain anyway.
Comment 6 Philipe Mulet CLA 2003-08-29 10:33:40 EDT
Remember to tag the implementation as deprecated using a javadoc comment. I 
checked it works ok then.
Comment 7 John P. A. Verhaeg CLA 2003-08-29 11:03:47 EDT
Okay, I think we can close this bug.  I misunderstood what you meant 
by "implementation".  I thought you meant the entire class, not just the 
methods in question.  It turns out these methods had non-JavaDoc comments 
(since the default code generation comment template specifies non-JavaDoc 
comments for some odd reason).  After changing these to JavaDoc comments and 
adding the @deprecated tag to them, the warnings went away.
Comment 8 Philipe Mulet CLA 2003-09-01 04:32:04 EDT
Glad it works now. Closing
Comment 9 Eclipse Genie CLA 2015-02-10 03:45:35 EST
New Gerrit change created: https://git.eclipse.org/r/41488
Comment 10 Eclipse Genie CLA 2015-02-10 03:45:36 EST
New Gerrit change created: https://git.eclipse.org/r/41488