Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 144061

Summary: Automatic pruning of unreachable code
Product: [Eclipse Project] JDT Reporter: Missing name Mising name <wuntoy>
Component: UIAssignee: JDT-UI-Inbox <jdt-ui-inbox>
Status: RESOLVED WONTFIX QA Contact:
Severity: enhancement    
Priority: P3 Keywords: helpwanted
Version: 3.2   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Missing name Mising name CLA 2006-05-26 21:55:41 EDT
There should be an option to prune/delete code not reachable from a selected method or class.  For example, prior to packaging an application for deployment the Eclipse user could select the main() method and then Source/Prune Unused Code to delete methods, fields and classes that would never be invoked if the product was only called through that main() method.  This would ensure that redundant code isn't accidentally left in.  It would also be a useful means by which to derive minimal test cases from existing code exhibiting erroneous behaviour.

The user would need to be warned that such an operation could result in files being deleted and that code elements invoked by reflection may be treated as unreachable.
Comment 1 Martin Aeschlimann CLA 2006-05-29 11:46:29 EDT
Would be nice to have, I agree. However, this would be functionality that could nicely be provided by an extra (code audit tools) plugin. Setting to 'later, helpwanted' as we currently don't have the manpower for this.
Comment 2 Missing name Mising name CLA 2006-05-29 12:48:22 EDT
I've just seen bug 25097 proposing a 'delete refactoring' which appears to be a similar idea, though not necessarily as end-to-end.
Comment 3 Denis Roy CLA 2009-08-30 02:23:24 EDT
As of now 'LATER' and 'REMIND' resolutions are no longer supported.
Please reopen this bug if it is still valid for you.