zoukankan      html  css  js  c++  java
  • 推荐个Java代码质量检测的利器 —— FindBugs

    一、下载

    插件的下载地址(sourceforge):FindBugs-Eclipse插件

    二、安装

    Eclipse插件的安装,就不多说了。

    三、使用

    1、找一个Project,选中它(也可以针对某个Package或者某个Java文件),右键,会看到如下图所示的菜单。点击【Find Bugs】,看一下运行的结果,你就知道这是干什么用的了。

      

    2、检查完以后,在 Bug Explorer 视图中,会看到结果,如图。都是些明显或者不明显的BUG。

      例如,

      a、Comparison of String objects using == or !=

        使用 == 或者 != 来判断两个 String 对象是否相等

      b、Dead store to local variable

        对局部变量重新赋值以后又没有使用

      c、Exception created and droped rather than thrown

        创建(new)了一个异常,但没有抛出(throw)

      d、Nullcheck of value previously dereferenced

        可能会抛出 NullPointerException 异常的代码

      .

      .

      .

      

  • 相关阅读:
    windows7 下 oracle 10g服务端如何安装?
    DOM模块支持测试
    获取css属性
    在webstorm启动nginx服务器
    获取link链接
    innerText
    外部动态加载javascript
    外部动态加载css
    冒泡排序
    Nodelist
  • 原文地址:https://www.cnblogs.com/memory4young/p/eclipse-plugin-findbugs.html
Copyright © 2011-2022 走看看