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参数使用= =或引用相等!=运算符。要求调用方通过只有字符串常量或拘留一种字符串是不必要的脆弱,很少获得显著的性能提升。考虑使用等于(对象)方法。)

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值