Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » Find unused public methods
Find unused public methods [message #196694] Thu, 24 February 2005 03:16 Go to next message
Eclipse UserFriend
Originally posted by: not.public.com

Is there any plugin that would be able to find unused non-private methods?
I've serached for and tried several, but all seem to be limited to unused
variables and private methods.
Re: Find unused public methods [message #196702 is a reply to message #196694] Thu, 24 February 2005 03:42 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: user.server.com

IIRC, Eclipse can't do that :( In the mean time, you can use IntelliJ IDEA
to find dead code.

Tom
Re: Find unused public methods [message #196718 is a reply to message #196694] Thu, 24 February 2005 04:16 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: scheglov_ke.nlmk.ru

Janne :

> Is there any plugin that would be able to find unused non-private
> methods? I've serached for and tried several, but all seem to be limited
> to unused variables and private methods.

If I develop library, many of my public methods will look as unused,
but they are used, just not in this project (or even workspace).


--
SY, Konstantin.
Advanced Eclipse SWT Designer (http://www.swt-designer.com)
Re: Find unused public methods [message #196725 is a reply to message #196718] Thu, 24 February 2005 05:26 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: user.server.com

> If I develop library, many of my public methods will look as unused,
> but they are used, just not in this project (or even workspace).

Not when you have unit tests ;P

Tom
Re: Find unused public methods [message #196910 is a reply to message #196718] Fri, 25 February 2005 03:40 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: e_news.desole.demon.nl

Konstantin Scheglov wrote:
>
> If I develop library, many of my public methods will look as unused,
> but they are used, just not in this project (or even workspace).

but if I don't develop a library, but an application, the methods that
look as unused are actually unused.
So you should be able to decide when to do that and when not.
Re: Find unused public methods [message #197421 is a reply to message #196910] Wed, 02 March 2005 17:09 Go to previous messageGo to next message
Eclipse UserFriend
Andrea Desole wrote:

> Konstantin Scheglov wrote:
>>
>> If I develop library, many of my public methods will look as unused,
>> but they are used, just not in this project (or even workspace).

> but if I don't develop a library, but an application, the methods that
> look as unused are actually unused.
> So you should be able to decide when to do that and when not.
Then correct me if I am wrong why can't you just find all the references
to
a suspect method in your project. If eclipse can't find any remove the
method.

I know it would be nice to have a button that goes through and gets the
reference count of all methods in your project and removes all with 0.

David
Re: Find unused public methods [message #197527 is a reply to message #197421] Thu, 03 March 2005 08:36 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: user.server.com

> Then correct me if I am wrong why can't you just find all the references
> to a suspect method in your project. If eclipse can't find any remove
> the method.

Why can't eclipse do this with one keystroke like IDEA does with Alt-Del?

Tom
Re: Find unused public methods [message #197543 is a reply to message #197527] Thu, 03 March 2005 10:00 Go to previous message
Eclipse UserFriend
Originally posted by: eclipse.rizzoweb.com

Thomas Singer wrote:
>> Then correct me if I am wrong why can't you just find all the
>> references to a suspect method in your project. If eclipse can't find
>> any remove the method.
>
>
> Why can't eclipse do this with one keystroke like IDEA does with Alt-Del?

Because that is a dangerous operation that, if provided, should require
a little bit of effort so as to prevent accidental invocation.
As someone already pointed out, just because a method is not referenced
in a certain project does not mean it should be removed. There are
numerous types of Projects where that would be the wrong thing to do.

If there were a macro/scripting capability, then individual users could
implement this themselves. But alas, there is no such facility yet...
https://bugs.eclipse.org/bugs/show_bug.cgi?id=37936

Eric
Previous Topic:Plug-in for making variables final - where to start
Next Topic:Eclipse 3.1M5a and J2SE 5.0: "Syntax error, varargs are only available if source level is 5.0&
Goto Forum:
  


Current Time: Tue Jul 22 14:43:59 EDT 2025

Powered by FUDForum. Page generated in 0.05340 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top