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:11:09 GMT
I remember there's a Java tools with an ANT wrapper that can generate a JAR
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. It's
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 used
at the method level???

Also, you might use Jakarta's BCEL to parse class files, including the code
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

 -----Original Message-----
From: 	Scott Ellsworth [] 
Sent:	Friday, March 22, 2002 3:44 PM
To:	Ant List
Subject:	Tool to find unused methods

Hi, all.

We have twenty-some-odd projects that are built via ant, and then 
assembled into a few dozen executables.  These have grown organically 
for several years, and thus have a fair amount of detritus in the java 

It would be really neat to find methods and classes that have become out 
of date, stale, or just plain superfluous.  For example, we would love 
to know which of our many projects are still using which deprecated 
methods, and how many users there are of some methods we have not yet 
decided to deprecate.

Can anyone recommend a hopefully open source tool that works well with 
ant which will tell us what we are not using?  I could accept sending it 
a single or small list of method signatures and the jars that might use 
them, in return for a list of dependent classes.

(I looked at depend, but it did not seem to do this in a human readable 


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

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

View raw message