您的位置:首页 > 其它

FindBugs 使用 及 常见错误解决方法

2016-04-15 17:04 459 查看
目录

FindBugs 使用 及 错误解决方法
idea 安装findbugs我这里已经安装过了

使用findbugs检查代码

常见错误

FindBugs 使用 及 错误解决方法

idea 安装findbugs,我这里已经安装过了



使用findbugs检查代码



常见错误

1、Private method is never called

This private method is never called. Although it is possible that the method will be invoked through reflection, it is more likely that the method is never used, and should be removed.(私人方法永远不会被调用这种私人方法永远不会被调用。虽然这是可能的,通过反射的方法将被调用,它是更可能的方法是从未使用过,并且应该被删除。)

2、Comparison of String parameter using == or !=

This code compares a java.lang.String parameter for reference equality using the == or != operators. Requiring callers to pass only String constants or interned strings to a method is unnecessarily fragile, and rarely leads to measurable performance gains. Consider using the equals(Object) method instead.(使用=或字符串参数的比较!=这个代码比较java.lang.string参数使用= =或引用相等!=运算符。要求调用方通过只有字符串常量或拘留一种字符串是不必要的脆弱,很少获得显著的性能提升。考虑使用等于(对象)方法。)
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: