findbugs 出错类型及对应解释
1、Dead store to local variable 本地变量存储了闲置不用的对象
举例:
List accountCoList = new ArrayList();
我们为accountCoList新建了一个对象,但是程序的后面并没有使用这个这个新建对象。
建议改为:
List accountCoList = null;
2、Write to static field from instance method 向static字段中写入值
举例:
private static DBRBO dbrBO;
public final void refresh() {
danskeBankBO = null;
dbrBO = null;
fileAndPathBO = null;
}
建议改为:
去掉static。
3、Load of known null value 大体意思是加载了null的对象。
举例
if (null == boList) {
for (int i = 0; i < boList.size(); i++) {
entityList.add(productBOToEntity(boList.get(i)));
}
}
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,
the same string value may be represented by two different String objects. Consider using the equals(Object) method
instead.
从字面意思可以理解String对象进行比较的时候:只有两种情况可以使用== or !=的,这两种情况是;在源文件中是个常数或者是调用
String.intern()方法,使用String的规范化表示形式来进行比较,如果不是这两中情况的话推荐使用.equals(object)方式
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,
or java.lang.Object, and does not appear to implement the Externalizable interface or the readObject()
and writeObject() methods.? Objects of this class will not be deserialized correctly if a non-Serializable object
is stored in this field.
这个错误的意思是:在可序列化的类中存在不能序列化或者不能暂存的数据
分享到:
相关推荐
findbugs错误类型的中文解释 findbugs 错误类型 中文解释 bug type
共整理了findbugs错误类型37个,有错误举例,同时附有正确写法。
findbugs 1.3.9 findbugs 1.3.9 findbugs 1.3.9 findbugs 1.3.9 findbugs 1.3.9 findbugs 1.3.9
findbugs1.3.8错误类型说明及中文对照
FindBugs 是由马里兰大学提供的一款开源 Java静态代码分析工具。FindBugs通过检查类文件或 JAR文件,将字节码与一组缺陷模式进行对比从而发现代码缺陷,完成静态代码分析。FindBugs既提供可视化 UI 界面,同时...
findbugs安装及使用手册,方便开发人员检查自身代码问题,
findbugs在eclipse中安装及使用,包含如何导出简易报表
用于findbugs安装配置,及findbugs结果导出分析文档
赠送jar包:findbugs-annotations-1.3.9-1.jar; 赠送原API文档:findbugs-annotations-1.3.9-1-javadoc.jar; 赠送源代码:findbugs-annotations-1.3.9-1-sources.jar; 赠送Maven依赖信息文件:findbugs-...
findbugs插件及安装
插件安装时,我们只需在eclipse根目录下新建一个【links】目录,然后在里面创建【.link】扩展名的文件,在里面写上类似于【path=F:\\IDE\\eclipsePlugin\\findbugs\\findbugs1.3.4】这样的配置信息,不就可以统一...
findbugs.jar开发findbugs自定义插件
在这个由两部分组成的系列文章的第一部分中,高级软件工程师 Chris Grindstaff 分析了 FindBugs 如何帮助提高代码质量以及排除隐含的缺陷。代码质量工具的一个问题是它们容易为开发人员提供大量但并非真正问题的问题...
FindBugs安装及用法 FindBugs是Eclipse的一个插件,是一个静态分析工具
SonarQube的FindBugs插件sonar-findbugs-plugin.jar(版本:4.0.1-SNAPSHOT),包含FindBugs Security Audit等规则,可以离线集成到sonarqube。
findBugs解释,用于静态代码检查findBugs解释,用于静态代码检查
findbugs常见5种类型报错,eclipse查错工具,很实用。
findbugs描述的中英文对照,使用说明
findbugs2.0.2在eclipse4.3中安装及使用,包含如何导出简易报表
Findbugs安装及使用说明.doc下载, Findbugs安装及使用说明.doc下载