findbugs可以检测未使用的公共方法 [英] Can findbugs detect unused public methods

查看:89
本文介绍了findbugs可以检测未使用的公共方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以使用FindBugs检测源树中未使用的方法?我在SO上看到一些帖子,用户声称这样做,有些人在FB中询问如何做到这一点以及其他人声称FB无法做到这一点。

Is it possible to detect unused methods in a source tree using FindBugs? I see some posts on SO where users are claiming to do that, some others asking how to do this in FB and others where they claim FB cannot do this.

有谁知道这是怎么做到的?我只对未在其他地方明确调用的方法感兴趣,我不关心反射。

Does anyone know for sure how this is done? I am only interested in methods that are not explicitly called from elsewhere, I don't care about reflection.

推荐答案

作为FindBugs团队的成员我可以告诉你,不幸的是FindBugs 这样做。如果您在我们的网站上搜索错误模式,那么唯一提到的未使用探测器就是未使用的字段

as a member of the FindBugs team I can tell you that unfortunately FindBugs does not do this. If you search through the bug patterns on our website, the only mentions of "unused" detectors is for unused fields.

这篇关于findbugs可以检测未使用的公共方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆