First, the installation of Findbug
I chose to install online, the steps are as follows
MyEclipse-->help-->install from Site
The interface that appears after
After clicking 4, click Next, then install successfully.
Second, the use of Findbug
MyEclipse-->windows-->show View-->other-->findbugs
Click Bug Explorer--ok, which appears as
MyEclipse has a bug Explorer in the view.
Third, find the bug in the project
Click Project Name--right click on Find Bugs-->find Bugs
At this time the Findbug plugin starts scanning all bugs that exist in this project,
After my project scan, I see the following bug
It is obvious that the null pointer exception, when the program aisle catch, the Ro object is null, with the Null.setresultcode method, will definitely error, modify the method as follows:
That is, add the following two sentences, check again, the bug disappears
A new object is required here, otherwise the exception returns null pointer exception error resultobject = new Resultobject ();
End.
Java--findbug Use