Hi all,
We would like to know the classes and methods that are called from
each class/method in our source base. One way is to insert @link tags
or @see tags, then generate javadoc, but is there an automatic way or
a better way (meaning javadoc is not a requirement)? We are using
Eclipse; I have not found a plugin that does this, but maybe I missed
the right one :)
Thanks,
Alejandrina
alejandrina - 27 Feb 2008 19:12 GMT
> Hi all,
>
[quoted text clipped - 8 lines]
>
> Alejandrina
Another solution would be some sort of "call hierarchy" tool that can
provide a complete call tree for a given class (or a whole project...)
with the ability to save the results to some file. Any ideas?
Alejandrina
Daniel Pitts - 27 Feb 2008 20:28 GMT
>> Hi all,
>>
[quoted text clipped - 14 lines]
>
> Alejandrina
What you're asking for falls under "static analysis". I don't know if
you'll find anything, but googling for it might help.
Certain tools (I use Intellij IDEA) will let you search for uses of a
particular method. I don't know if that is good enough for your actual
need (as you haven't specified what you're goal is).
The hard thing is that it can only include calls from code that you
provide. If someone else uses your code from a different source tree,
you're out of luck.

Signature
Daniel Pitts' Tech Blog: <http://virtualinfinity.net/wordpress/>
Andrea Francia - 27 Feb 2008 21:07 GMT
With Netbeans you can search usages of a class or method simply with
right click -> Find Usages. I don't know if there is a similar function
in Eclipse.
> Hi all,
>
[quoted text clipped - 8 lines]
>
> Alejandrina
alejandrina - 27 Feb 2008 21:47 GMT
On Feb 27, 4:07 pm, Andrea Francia <andrea.fran...@gmx.it.invalid>
wrote:
> With Netbeans you can search usages of a class or method simply with
> right click -> Find Usages. I don't know if there is a similar function
[quoted text clipped - 12 lines]
>
> > Alejandrina
Actually there is a nifty Call Hierarchy plugin that does both ways
(who does this method call and who calls this method). This is not
sufficient, however: what I am looking for is a tool that does this
for (at a minimum) all the methods in a class and lets me export the
results to (for example) a text file or XML file or whatever.
Does anyone know if such a tool exists?
Thanks,
Alejandrina
Larry A Barowski - 28 Feb 2008 07:14 GMT
> Hi all,
>
[quoted text clipped - 4 lines]
> Eclipse; I have not found a plugin that does this, but maybe I missed
> the right one :)
If you want to roll your own, it is much easier to do this
for compiled classes rather than source. A minimal class
file scanner (all you need are class references from the
constant pool) is very simple. I would guess that you can
create your own tool in less time than you will spend
searching for one, and yours will do exactly what you
want in exactly the way you want.
alejandrina - 29 Feb 2008 19:59 GMT
On Feb 28, 2:14 am, "Larry A Barowski"
<ThisisLarrybarAtEngDotAuburnDotLearninginstitution> wrote:
> > Hi all,
>
[quoted text clipped - 12 lines]
> searching for one, and yours will do exactly what you
> want in exactly the way you want.
Intriguing...All I need now is some free time to do this :)
Thanks, I learned something new thanks to you
Alejandrina
Zig - 29 Feb 2008 07:18 GMT
> Hi all,
>
[quoted text clipped - 8 lines]
>
> Alejandrina
The "universal" way:
1) Rename your method
2) Recompile
3) See what blows up
The Eclipse way:
1) Click on the the method in source code
2) Ctrl+Shift+G
HTH,
-Zig
alejandrina - 29 Feb 2008 19:55 GMT
> > Hi all,
>
[quoted text clipped - 21 lines]
>
> -Zig
Thanks, but I need a tool that does this FOR ALL THE CLASSES IN A
PROJECT, not one Ctrl-Shift-G at a time. It is clear that Eclipse
knows this, but I don't know how to extract it in "report" form.
Alejandrina