FindBug,Java代码的监督者
2007-12-17 10:55
381 查看
FindBugs是个相当有趣的小工具,可以分析出Java程序中常见的“坏代码”——这些代码可能是效率不彰(例如创建不必要的对象),也可能有安全性或稳定性方面的隐患(例如不恰当的同步、未关闭的文件句柄)。我用FindBugs检查了一下JUnit,发现了好几处小问题;而对J2SE 1.4.2 Runtime的检查更是发现问题一大堆。你自己的程序,是不是也该做做检查呢? 目前这个小玩意还只能检查.jar里的.class文件,不能不说是一点缺憾,使用起来也多少有点麻烦。你有没有兴趣给它做做加工完善呢? —————————————— FindBugs is a program which looks for bugs in Java code. It can detect various coding "mistakes" including thread synchronization problems and misuse of API methods. It includes both Swing and command line interfaces.
The new version adds new bug detectors:
- Places where a null pointer might be dereferenced
- I/O streams that are opened, do not escape the method, and are not closed on all paths out of the method
- Methods that can return null instead of a zero-length array
- Using the == or != operators to compare String objects
Other changes in this version:
- Command line interface can save bugs as XML
- GUI can save bugs to and load bugs from XML
- An "Annotations" window in the GUI allows the user to add textual annotations to bug reports; these annotations are preserved when bugs are saved as XML
- In this release, the Japanese bug summary translations by Germano Leichsenring are really included (they were inadvertently omitted in the previous release)
- Completely rewrote the control flow graph builder, hopefully for the last time
- Simplified implementation of control flow graphs, which should reduce memory use and possibly improve performance
- Improvements to command line interface (list bug priorities, filter by priority, specify aux classpath, specify project to analyze)
- Various bug fixes and enhancements
Check out the open source FindBugs
Trackback: http://tb.blog.csdn.net/TrackBack.aspx?PostId=2404
The new version adds new bug detectors:
- Places where a null pointer might be dereferenced
- I/O streams that are opened, do not escape the method, and are not closed on all paths out of the method
- Methods that can return null instead of a zero-length array
- Using the == or != operators to compare String objects
Other changes in this version:
- Command line interface can save bugs as XML
- GUI can save bugs to and load bugs from XML
- An "Annotations" window in the GUI allows the user to add textual annotations to bug reports; these annotations are preserved when bugs are saved as XML
- In this release, the Japanese bug summary translations by Germano Leichsenring are really included (they were inadvertently omitted in the previous release)
- Completely rewrote the control flow graph builder, hopefully for the last time
- Simplified implementation of control flow graphs, which should reduce memory use and possibly improve performance
- Improvements to command line interface (list bug priorities, filter by priority, specify aux classpath, specify project to analyze)
- Various bug fixes and enhancements
Check out the open source FindBugs
Trackback: http://tb.blog.csdn.net/TrackBack.aspx?PostId=2404
相关文章推荐
- FindBug,Java代码的监督者
- 静态java代码检查工具-findbug使用简介
- Findbug插件静态java代码扫描工具使用
- Embedded EJB3用java代码作为客户端调用bug
- 推荐一款Java代码Bug分析插件 FindBugs
- 提高代码质量——使用FindBug自动Review
- java代码中find()函数访问MongoDB数据库
- 修复 SyntaxHighlighter 3.0.83 Java 代码多行注释 Bug
- Java代码Bug分析插件 FindBugs
- EXTjs4.0的store的findRecord的BUG演示代码
- 【Android】Android Layout Binder——根据layout布局文件自动生成findViewById的java代码的神器
- android 升级ADT到22后,出现bug: Could not find class,或者Caused by: java.lang.ClassNotFoundException:异常
- 修复 SyntaxHighlighter 3.0.83 Java 代码多行注释 Bug
- 浏览器兼容性问题,为什么同一段JavaScript代码,不同浏览器上为什么会产生不同效果,甚至bug?浏览器不就是严格按照JavaScript语法进行的吗?java代码为什么从来没听过有什么兼容问题?
- PMD和FindBug的代码质量检查
- Android(java)学习笔记113:Android编写代码调用Vibrator震动功能(Bug:按下按钮button始终没有震动)
- 修复 SyntaxHighlighter 3.0.83 Java 代码多行注释 Bug
- 头像截取 部分Java代码 屎一样 有bug
- 一款工具助你减少java代码bug