当前位置:首页 > 服务端 > FindBugs Tutorial

FindBugs Tutorial

FindBugs is an useful tool that can find potential problematic code in your Java program. It differs from CheckStyle and PMD in that it analyzes Java bytecode, not the human-readable source file, to find potential bug patterns. Follow this tutorial to see how to use FindBugs in Eclipse!

 

1. In Eclipse, click Help -> Install new software. In the opened dialogue, click "Add". Type in FindBugs as the name and "http://findbugs.cs.umd.edu/eclipse" as the URL. Click "OK" to proceed.

 

2. Select "FindBugs" and click "Next"

FindBugs Tutorial _ JavaClub全栈架构师技术笔记

 

3. Eclipse will begin downloading the software. Agree to any prompted licenses or user agreements to proceed.

 

4.  Right-click the project, select Find Bugs -> Find Bugs in the context menu.

FindBugs Tutorial _ JavaClub全栈架构师技术笔记

 

5. Wait a few seconds/minutes while it checks your project

FindBugs Tutorial _ JavaClub全栈架构师技术笔记

 

6. When finished, it will report how many bugs it has found. Click "yes" to open the FindBugs perspective to view the bugs.

FindBugs Tutorial _ JavaClub全栈架构师技术笔记

 

7. In the Bug Explorer window, you can see a summary of the bugs found.

FindBugs Tutorial _ JavaClub全栈架构师技术笔记

8. Double click one bug to see exactly which line is problematic. Here it says two strings should be compared with the "equals()" method, not the  "==" operator.

FindBugs Tutorial _ JavaClub全栈架构师技术笔记

 

 9. Make changes accordingly, and check again to make sure there are no more bugs.

FindBugs Tutorial _ JavaClub全栈架构师技术笔记

 

That's all for this tutorial. Hopefully you'll find it useful. More information about FindBugs can be found at http://findbugs.sourceforge.net/.

 

Feedbacks and suggestions are greatly appreciated.

 

作者:TU_HZ
来源链接:https://www.cnblogs.com/tuhz/p/4521066.html

版权声明:
1、Java侠(https://www.javaxia.com)以学习交流为目的,由作者投稿、网友推荐和小编整理收藏优秀的IT技术及相关内容,包括但不限于文字、图片、音频、视频、软件、程序等,其均来自互联网,本站不享有版权,版权归原作者所有。

2、本站提供的内容仅用于个人学习、研究或欣赏,以及其他非商业性或非盈利性用途,但同时应遵守著作权法及其他相关法律的规定,不得侵犯相关权利人及本网站的合法权利。
3、本网站内容原作者如不愿意在本网站刊登内容,请及时通知本站(javaclubcn@163.com),我们将第一时间核实后及时予以删除。





本文链接:https://www.javaxia.com/server/124571.html

分享给朋友:

“FindBugs Tutorial” 的相关文章

实习第一周(Golang)2022年05月14日 16:18:05
常用日志框架介绍2022年05月19日 20:04:06
如何学习一门语言2022年05月23日 21:03:30
信息系统合同管理2022年05月24日 22:14:31
信息系统项目管理案例22022年05月24日 22:36:24
Nacos Cluster Building2022年05月26日 21:34:55