cerulean

FindBugs

FindBugs,http://findbugs.sourceforge.net/
发现代码中潜在bug的工具,有eclipse的插件,安装后右键单击java project name,点击Find Bugs,切换到FindBugs得perspective可以看到结果,速度还比较快,比之前用过的一个(虽然已经记不得名字了)快一些~具体的效果还是要逐个分析。

Bug categories:

Correctness bug
Probable bug - an apparent coding mistake resulting in code that was probably not what the developer intended. We strive for a low false positive rate.
Bad Practice
Violations of recommended and essential coding practice. Examples include hash code and equals problems, cloneable idiom, dropped exceptions, serializable problems, and misuse of finalize. We strive to make this analysis accurate, although some groups may not care about some of the bad practices.
Dodgy
Code that is confusing, anomalous, or written in a way that leads itself to errors. Examples include dead local stores, switch fall through, unconfirmed casts, and redundant null check of value known to be null. More false positives accepted. In previous versions of FindBugs, this category was known as Style.
Multithreaded correctness
     Incorrect lazy initialization and update of static field
     Calls Thread.sleep() with a lock held: better to use wait(lock)
     Synchronization on interned String could deadlock: 最好不用字符串,以免重复
Performance
     invokes inefficient new String() constructor
     concatenates strings using + in a loop: better to use append StringBuffer
     inner class usage


posted on 2009-08-14 16:04 cerulean 阅读(954) 评论(0)  编辑  收藏 所属分类: Java


只有注册用户登录后才能发表评论。


网站导航:
 

导航

<2009年8月>
2627282930311
2345678
9101112131415
16171819202122
23242526272829
303112345

统计

常用链接

留言簿(3)

随笔分类

随笔档案

搜索

最新评论

阅读排行榜

评论排行榜