Very cool and very timely! After
restructuring the CDT indexer I know I have a lot of dead code from the old
one. I can’t wait to try this out.
Thanks, John and Co.
From:
eclipse-dev-bounces@xxxxxxxxxxx [mailto:eclipse-dev-bounces@xxxxxxxxxxx] On Behalf Of John Arthorne
Sent: Friday, July 14, 2006 1:34
PM
To: eclipse-dev@xxxxxxxxxxx
Subject: [eclipse-dev] Core tools
updates
Over time, plugins tend to accumulate dead code -
classes, methods, and fields that are no longer used. Dead code has
maintenance cost and adds to the download and install size of Eclipse, so it's
worth finding and deleting such code where appropriate. The
org.eclipse.core.tools plugin has a utility for locating unused methods and
fields, and Martin Aeschlimann from JDT recently provided a patch to remove
false matches and present results in the Search view. To use the tool:
1)
Download org.eclipse.core.tools v1.4.0 from here:
http://www.eclipse.org/eclipse/platform-core/downloads.php
2)
Install the new plugins in a product extension (only org.eclipse.core.tools is
actually needed for this utility). Or, add to an existing install and restart
with -clean.
3)
Startup with a workspace that contains all projects that are likely to
reference the code in question (test suites, fragments, friend plugins, etc)
4)
Select one or more Java projects, packages, or types in the Package Explorer,
and invoke "Find Unreferenced Members" from the context menu. For
most Eclipse projects, selecting all non-API packages is a good start, although
it is possible for API packages to contain unused package-private members, or
protected members in final classes that can be deleted.
5)
Browse the results in the Search view. The results can be sorted by name
or path. Keep in mind that classes instantiated through reflection, such
as executable extensions, may appear to be unreferenced even though they are
used.
In
other "core tools" news, the workspace rebuilder plugin has also been
updated for Eclipse 3.x. This plugin will help restore workspaces that
are hopelessly corrupt and cannot otherwise be started. It is available
from the same download link mentioned in 1) above.
John