ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dominique Devienne <>
Subject RE: Tool to find unused methods
Date Mon, 25 Mar 2002 16:26:12 GMT
Thanks for stating the main caveat of such tools, Drew. Most tools are not
magic bullets, and require proper use and understanding of their internal
functioning. It's up to us to use them diligently. I'm sure the jarmaker (or
whatever it's real name is) folks have thought of that too. At the very
least it's up to you to provide com.lgc.Foo as one the starting point for
the search. And you can always unit test and test the generated JARs once
generated to ensure you didn't miss anything. It's all a matter of

In the question at hand, it was more to remove dead code than to package a
lean Java app anyway. --DD

 -----Original Message-----
From: 	Drew Davidson [] 
Sent:	Monday, March 25, 2002 10:23 AM
To:	Ant Users List
Subject:	Re: Tool to find unused methods

Dominique Devienne wrote:

> I remember there's a Java tools with an ANT wrapper that can generate a
> file with only the pieces needed by an application. You give it a few
> starting classes, and it finds and adds to the JAR all the dependent
> classes. I believe it's on sourceforge, but I can't remember its name.
> the closest I can think of your problem. The granularity is at the class
> level, since concerns itself with generating JARs, but maybe it can be
> at the method level???
> Also, you might use Jakarta's BCEL to parse class files, including the
> of methods.
> Something you might try is to use javap.exe to convert the class file in
> ASCII, and grep/seach it!?!?!?
> I hope this helps. --DD

I generally wouldn't want to use such tools in any code for which you don't
have intimate knowledge because java allows lots of dynamic behaviour wrt
loading.  I can do:


without having to import, so a dependency analysis based on
will fail to add to the jar.

- Drew

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message