Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[wtp-dev] Removing dead code from WTP

The tool described below can help us find dead code that are no longer used. I did a quick scan against a few of the WTP plug-ins, and it's amazing how much stuff came up!

Each component should scan its plug-ins for dead code and remove anything that is not needed. I have opened bug 150849 [1] to track the progress of this work. If you have reviewed your component, please add a comment to the bug and indicate which component has been reviewed.



Jeffrey Liu
IBM Rational Software
IBM Toronto Lab.
8200 Warden Ave. Markham, Ontario, L6G 1C7
Internal mail: D3/UMZ/8200/MKM (D3-268)
T/L: 969 3531
Tel: (905) 413 3531
Fax: (905) 413 4920

----- Forwarded by John Arthorne/Ottawa/IBM on 14/07/2006 01:34 PM -----
John Arthorne/Ottawa/IBM

14/07/2006 01:34 PM

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 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 v1.4.0 from here:

2) Install the new plugins in a product extension (only 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.


Back to the top