Suppose in my project written in Java I have some classes and each of these classes has some methods. I want to know which methods never invoked in my project. I implemented a simple program by using a Parser to extact the name of all methods in my project through using the first line of method's definitions. But my question is that "Is there any parser or software to extract the method's invocation".
Asked
Active
Viewed 134 times
2 Answers
2
Oh my god. Just use the IDE. Either IntelliJ Idea or Eclipse or NetBeans can do the search. Even Idea will grey out the unused methods. Also, uou can trigger the search by Alt + F7 keystroke on the method name.

Vladimir Ivanov
- 42,730
- 18
- 77
- 103
-
You might want to add NetBeans to the list of IDEs. – Waldheinz May 31 '11 at 13:39
-
But the project I am working on is really huge , mayby more than 1000 classes with a lots of methods, by this situation what it is better to do, and also I like to have an output to show which methods are useless. – Hadi May 31 '11 at 13:40
-
@Hadi: Still, learn to use the existing tools instead of re-inventing the wheel. – Waldheinz May 31 '11 at 13:41
-
1In IntelliJ you can search for all unused fields/methods/classes and remove them on mass if you wish. – Peter Lawrey May 31 '11 at 13:41
0
Project Jackpot is a tool to do this kind of transformation. See this presentation for more information.
It seems to have migrated to a separate project on bitbucket.

Jeff Foster
- 43,770
- 11
- 86
- 103