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


Here's a helpful hit for tracking known dead code:

There an interface in org.eclipse.wst.common.frameworks being used by the J2EE team to help track dead code called: org.eclipse.wst.common.frameworks.internal.DoNotUseMeThisWillBeDeletedPost15 in order to keep track of dead code we wish to delete but can't at the moment.  Any dead classes or interfaces we've come across have implemented this interface while dead methods reference the interfaces via javadoc.  Thus, we can use the compiler to keep track of this dead code to delete in the future (when we start the 2.0 stream).  


Thank you,

Jason A. Sholl
jsholl@xxxxxxxxxx
919-543-0011 (t/l 441-0011)



Jeffrey Liu <jeffliu@xxxxxxxxxx>
Sent by: wtp-dev-bounces@xxxxxxxxxxx

07/17/2006 02:42 PM

Please respond to
"General discussion of project-wide or architectural issues." <wtp-dev@xxxxxxxxxxx>

To
"General discussion of project-wide or architectural issues." <wtp-dev@xxxxxxxxxxx>
cc
Subject
[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.


[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=150849


Thanks,


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
jeffliu@xxxxxxxxxx


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

14/07/2006 01:34 PM


To
eclipse-dev@xxxxxxxxxxx
cc
Subject
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
_______________________________________________
wtp-dev mailing list
wtp-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/wtp-dev