Bug 150849 - [releng] Remove dead code from WTP
Summary: [releng] Remove dead code from WTP
Status: RESOLVED WONTFIX
Alias: None
Product: WTP Releng
Classification: WebTools
Component: releng (show other bugs)
Version: 3.10   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: David Williams CLA
QA Contact: David Williams CLA
URL:
Whiteboard:
Keywords: info
Depends on:
Blocks:
 
Reported: 2006-07-17 14:23 EDT by Jeffrey Liu CLA
Modified: 2018-06-29 15:08 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jeffrey Liu CLA 2006-07-17 14:23:50 EDT
Remove dead code from WTP. Details below:

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.
Comment 1 Jeffrey Liu CLA 2006-11-29 16:08:06 EST
John, over to you. Thanks.
Comment 2 David Williams CLA 2007-10-03 17:52:03 EDT
I'm moving to "won't fix" simply because there's no specific plans to implement any thing project-wide in this area ... naturally, all dead code should be removed! and if anyone sees some, they can open specific bugs on specific components. 

I've put "info" in as a keyword, since the tool is a useful reference.