Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Searching for (and remove) unreferenced methods

Reply
Thread Tools

Searching for (and remove) unreferenced methods

 
 
Rogue Chameleon
Guest
Posts: n/a
 
      12-02-2004
Hi all

FYI: We are using WSAD 5.0 as our IDE.

Is there a simple (perhaps automated) way to find all methods in a
project that are not referenced by any other methods/classes? I'm sure
that there are some in our project, but short of checking each method
individually, I don't know how to get at them.

rogue chameleon

 
Reply With Quote
 
 
 
 
Heiner Kücker
Guest
Posts: n/a
 
      12-02-2004
Rogue Chameleon wrote
> FYI: We are using WSAD 5.0 as our IDE.
>
> Is there a simple (perhaps automated) way to find all methods in a
> project that are not referenced by any other methods/classes? I'm sure
> that there are some in our project, but short of checking each method
> individually, I don't know how to get at them.
>
> rogue chameleon
>


In Menu Window -> Preferences -> Java -> Compiler -> Problems
is possible to set:
unused private types, methods or fields:
Warning

This works only for private methods, but for other scopes.

It's possible to using public methods per reflection.
This is the reason for no checking this methods.

Heiner Kuecker
Internet: http://www.heinerkuecker.de http://www.heiner-kuecker.de
JSP WorkFlow PageFlow Page Flow FlowControl Navigation: http://www.control-and-command.de
Expression Language Parser: http://www.heinerkuecker.de/Expression.html


 
Reply With Quote
 
 
 
 
Martin Egholm Nielsen
Guest
Posts: n/a
 
      12-03-2004
> Is there a simple (perhaps automated) way to find all methods in a
> project that are not referenced by any other methods/classes? I'm sure
> that there are some in our project, but short of checking each method
> individually, I don't know how to get at them.

You should look at ProGuard - it's an optimisation tool that does that -
but to the compiled class-files, though. However, I reckon you can ask
it to tell which methods are unused...

// Martin Egholm
 
Reply With Quote
 
Rogue Chameleon
Guest
Posts: n/a
 
      12-14-2004
Thanks for the tips!

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Tool to get unreferenced image files? John Dalberg HTML 1 02-04-2005 08:06 PM
unreferenced local variable Alzane C++ 11 11-30-2004 09:49 PM
unreferenced (???) variable; prob. simple Halfdan Holger Knudsen Python 2 09-15-2003 11:41 PM
Re: unreferenced (???) variable; prob. simple Andy Jewell Python 0 09-15-2003 09:32 PM
find all unreferenced symbols, not by linker Tzu-Chien Chiu C++ 1 09-15-2003 05:30 PM



Advertisments