findbugs 出错类型及对应解释
1、Dead store to local variable 本地变量存储了闲置不用的对象
举例:
List accountCoList = new ArrayList();
我们为accountCoList新建了一个对象,但是程序的后面并没有使用这个这个新建对象。
建议改为:
List accountCoList = null;
2、Write to static field from instance method 向static字段中写入值
举例:
建议改为:
去掉static。
3、Load of known null value 大体意思是加载了null的对象。
举例
4、Exception is caught when Exception is not thrown 这个意思比较好理解:就是catch了异常但是try里并没有抛出异常
5、Method ignores exceptional return value 没有对方法的异常返回值进行检查
6、Comparison of String objects using == or !=
This code compares java.lang.String objects for reference equality using the == or != operators.
Unless both strings are either constants in a source file, or have been interned using the String.intern() method,
7、Method names should start with a lower case letter 这个好理解方法名的第一个字母不能是大写
8、Non-transient non-serializable instance field in serializable class
This Serializable class defines a non-primitive instance field which is neither transient, Serializable,
这个错误的意思是:在可序列化的类中存在不能序列化或者不能暂存的数据