findbugs 修复日志

1、SIC_INNER_SHOULD_BE_STATIC, Priority: Low
BUG描述:This class is an inner class, but does not use its embedded reference to the object which created it. This reference makes the instances of the class larger, and may keep the reference to the creator object alive longer than necessary. If possible, the class should be made static.(若成员类中未访问外围类的非静态成员,为避免额外的空间和时间开销,建议改用静态成员类。)

问题原因:非静态成员类和静态成员类的区别在于,非静态成员类是对象的,静态成员类是类的。非静态成员类可以访问外围类的任何成员,但前提是必须存在外围类对象。JAVA需要额外维护非静态成员类和外围类对象的关系,所以findbugs建议将其设为static型。

2、NP_NULL_PARAM_DEREF_ALL_TARGETS_DANGEROUS, Priority: Normal
A possibly-null value is passed at a call site where all known target methods require the parameter to be nonnull. Either the parameter is annotated as a parameter that should always be nonnull, or analysis has shown that it will always be dereferenced.

参数调用一般都不要设置为NULL,这样调用的方法可以能会出现空指针异常
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值