Is there any way to generate a list of classes in a Java project that are no longer needed by any other classes in that project?
Here’s a diagram to help illustrate the situation (I hope you enjoy my ASCII diagram since I don’t have enough rep to use an image), where C and B depend on project A:
A
/ \
/ \
C B
I started refactoring by moving code from B to A, so that it could be shared by C and B. However, now that I’m getting close to finishing refactoring, I want to check to see if there are any classes that I moved to A that can now be moved back down to B (classes that are in A but aren’t using by any code in A)
Is there some tool that I can use to generate a list of such classes for me?
JBoss Tattletale works well for this. I have used it in the past to figure out what third-party libraries are no longer needed by our project and also to learn about potentially conflicting packages/classes that are present in multiple JAR files.