Finding deprecated methods

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Finding deprecated methods

Javen O'Neal
The @deprecated annotation on many methods and classes doesn't include a
version or date when deprecated or scheduled for removal.

Due to whitespace changes, looking at svn blame (show annotations in ViewVC
and Subclipse) doesn't necessarily show when the class or method was first
deprecated.

Is there a smarter way to find deprecated classes besides checking out the
code from 2 final releases ago and removing any deprecated code that still
exists in trunk@HEAD?
Reply | Threaded
Open this post in threaded view
|

Re: Finding deprecated methods

Nick Burch-2
On Tue, 14 Jun 2016, Javen O'Neal wrote:
> Is there a smarter way to find deprecated classes besides checking out
> the code from 2 final releases ago and removing any deprecated code that
> still exists in trunk@HEAD?

I'd probably attempt it with:
* grep trunk for @deprecated with no date, with a -A 4 or similar, then
   grab the method name from that
* grab a list of old versions from "svn ls ^/poi/tags/"
* use "svn switch ^/poi/tags/xxxx/" to quickly walk your tree back through
   older versions
* do the same greps, and spot where they vanish

If that all sounds a bit hairy, let me know and I can try it later in the
week!

Nick

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

RE: Finding deprecated methods

Uwe Schindler
Hi,

You can also download the JAR files of those releases and use a comparison tool like http://siom79.github.io/japicmp/ to compare them. This tool can be run using CLI and also prints changes in @Deprecated.

The CLI syntax is here: http://siom79.github.io/japicmp/CliTool.html

I always use "-m" (only show modified stuff) and "-o" and "-n" to specify the old and new JAR file. After that you can grep on something like DEPRECATED.

Uwe

-----
Uwe Schindler
H.-H.-Meier-Allee 63, D-28213 Bremen
http://www.thetaphi.de
eMail: [hidden email]

> -----Original Message-----
> From: Nick Burch [mailto:[hidden email]]
> Sent: Wednesday, June 15, 2016 10:43 AM
> To: POI Developers List <[hidden email]>
> Subject: Re: Finding deprecated methods
>
> On Tue, 14 Jun 2016, Javen O'Neal wrote:
> > Is there a smarter way to find deprecated classes besides checking out
> > the code from 2 final releases ago and removing any deprecated code that
> > still exists in trunk@HEAD?
>
> I'd probably attempt it with:
> * grep trunk for @deprecated with no date, with a -A 4 or similar, then
>    grab the method name from that
> * grab a list of old versions from "svn ls ^/poi/tags/"
> * use "svn switch ^/poi/tags/xxxx/" to quickly walk your tree back through
>    older versions
> * do the same greps, and spot where they vanish
>
> If that all sounds a bit hairy, let me know and I can try it later in the
> week!
>
> Nick
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

RE: Finding deprecated methods

Javen O'Neal
Follow-on question: some deprecation warnings on say what the replacement
for the method or class is. Java's QuickFix sometimes gets it right if a
method is renamed, but punts when the parameters. Is there an easy way to
update old usages that's faster than per-usage or per-deprecation?

Is there a standard way we should be formatting our deprecation warnings to
make it trivial for our users to upgrade their code base?
On Jun 15, 2016 2:08 AM, "Uwe Schindler" <[hidden email]> wrote:

> Hi,
>
> You can also download the JAR files of those releases and use a comparison
> tool like http://siom79.github.io/japicmp/ to compare them. This tool can
> be run using CLI and also prints changes in @Deprecated.
>
> The CLI syntax is here: http://siom79.github.io/japicmp/CliTool.html
>
> I always use "-m" (only show modified stuff) and "-o" and "-n" to specify
> the old and new JAR file. After that you can grep on something like
> DEPRECATED.
>
> Uwe
>
> -----
> Uwe Schindler
> H.-H.-Meier-Allee 63, D-28213 Bremen
> http://www.thetaphi.de
> eMail: [hidden email]
>
> > -----Original Message-----
> > From: Nick Burch [mailto:[hidden email]]
> > Sent: Wednesday, June 15, 2016 10:43 AM
> > To: POI Developers List <[hidden email]>
> > Subject: Re: Finding deprecated methods
> >
> > On Tue, 14 Jun 2016, Javen O'Neal wrote:
> > > Is there a smarter way to find deprecated classes besides checking out
> > > the code from 2 final releases ago and removing any deprecated code
> that
> > > still exists in trunk@HEAD?
> >
> > I'd probably attempt it with:
> > * grep trunk for @deprecated with no date, with a -A 4 or similar, then
> >    grab the method name from that
> > * grab a list of old versions from "svn ls ^/poi/tags/"
> > * use "svn switch ^/poi/tags/xxxx/" to quickly walk your tree back
> through
> >    older versions
> > * do the same greps, and spot where they vanish
> >
> > If that all sounds a bit hairy, let me know and I can try it later in the
> > week!
> >
> > Nick
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [hidden email]
> > For additional commands, e-mail: [hidden email]
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>