开发者

In Eclipse, how do you find methods that you have defined but not used/called anywhere in the app?

开发者 https://www.devze.com 2023-01-23 03:48 出处:网络
I am concerned that some of the classes in my app have methods that are defin开发者_运维百科ed but not called anywhere in the app.

I am concerned that some of the classes in my app have methods that are defin开发者_运维百科ed but not called anywhere in the app.

In Eclipse is there a way to find these methods?


You can use Findbugs for this, but there's also a plugin dedicated to this: UCDetector.


Here's a related question and answers and a few other helpful links;

Find unused classes in a Java Eclipse project How to find unused/dead code in java projects http://www.velocityreviews.com/forums/t389551-identify-unused-methods.html

http://pmd.sourceforge.net/eclipse/

Hope that helps.


The quickest way to find usages of a single method would be to highlight the method, right click and go to "References", from there you can choose search location like workspace, project etc.

Obviously this wouldn't be a good way to find ALL the methods in the project that aren't being used, but it might be worth using if you just looking at one odd looking method that you can't figure out why you need.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号