Bug 103674 - Warning for unused libraries
Summary: Warning for unused libraries
Status: NEW
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows 2000
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard: 1
Keywords:
: 161133 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-07-13 12:04 EDT by Ilja Preuss CLA
Modified: 2011-03-29 09:14 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ilja Preuss CLA 2005-07-13 12:04:35 EDT
It would be nice if the compiler could flag unused libraries in the Build Path 
with a warning (that is, libraries that aren't needed to compile the project). 
Possibly with a quick fix to remove the library from the Build Path.
Comment 1 Olivier Thomann CLA 2006-10-06 16:28:57 EDT
Would be on the builder side.
Comment 2 Philipe Mulet CLA 2006-10-18 07:28:58 EDT
*** Bug 161133 has been marked as a duplicate of this bug. ***
Comment 3 Philipe Mulet CLA 2006-10-18 07:31:38 EDT
Trivial addition for batch compiler or full build scenario.
For incremental, we would need to record new dependencies so as for instance that a JAR is no longer needed after a one line change.

Feels more like a static analysis tool request (like find all deadcode etc...)
Comment 4 Philipe Mulet CLA 2006-10-18 10:56:16 EDT
Could also be implemented as a one time action (user could trigger it when configuring the classpath).
Comment 5 John Arthorne CLA 2006-10-18 11:33:42 EDT
That would work, either as part of the JDT UI "Clean Up" wizard, or in a separate Build path cleanup action.
Comment 6 Maxime Daniel CLA 2008-01-21 09:22:19 EST
In theory, nothing would prevent us from maintaining a cache of CUs to classpath entries relationships at the project level, and to refresh it according to newest builds (whenever a CU needs to be compiled again, the cache is purged from its associated entries). Looking at the code though, it is clear that a few tools needed to do so (like getting the link from a name environment answer back to its classpath entry, if any) are not in place.
Since this is in the builder area, I'll ask Kent to take over anyway.