Java – how to get a list of classes in a project that are no longer needed for anything in the project
Is there any way to generate a list of classes in a java project that are no longer needed by any other classes in the project?
This is a chart to help illustrate the situation (I hope you like my ASCII diagram because I don't have enough representatives to use images), where C and B depend on item a:
A / \ / \ C B
I started refactoring by moving the code from B to a so that it could be shared by C and B However, now that I'm close to completing the refactoring, I want to check whether there are any classes. I can move a back to B now (the classes in a but no code in a is used)
Are there any tools that can be used to generate such a list of classes for me?
Solution
JBoss tattletale applies to this I used it in the past to figure out which third-party libraries are no longer needed for our project, and to understand the potentially conflicting packages / classes in multiple jar files