1

I'm refactoring a java project. It seems that there are a lot of code (methods) used only within unit tests.

Is there a tool which could find all those methods?

So I'll need to find a list of methods within com.XXX projects which are:

  1. used only within com.XXX.test.XXX classes
  2. not marked with JMX autowired annotation
  3. classes themselves are not in com.XXX.test packages

I'd better to have it as a list, so I could attach it into the ticket within task-tracking system (bugzilla, jira)

I think that reflection could be used, but don't like to reinvent the wheel. Maybe there is a lib for that?

PS. there is a note that How to find unused/dead code in java projects question is the same, but there is a slight difference: the code is used, but in XXXTestXXX.java files.

Community
  • 1
  • 1
Bogdan
  • 702
  • 3
  • 6
  • 22

0 Answers0