FindBugs the bug used to find the code;
Installation method: Enter Eclipse MarketPlace query findbugs can be installed;
Perspective: FindBugs
View: Bug Explorer, bug Info, bug reviews
Bug Explorer is used to display a full overview of errors;
Bug info is used to display specific information for each bug;
If you want to use FindBugs, just right click on the source code interface and find "Find Bugs"--"Find Bugs", then we go to findbugs perspective;
The following code is an example:
Import Java.io.FileInputStream;
Import java.io.FileNotFoundException;
Import Java.io.InputStream;
public class Test1 {public
static void Main (string[] args) throws FileNotFoundException {
//1. Variables
not used InputStream in = new FileInputStream (args[0]);
2. String comparison bug string
str1 = "abc";
string[] str = new string[]{"abc", "CDE"};
SYSTEM.OUT.PRINTLN (Str1.equals (str));
}
}
The found bugs will appear in the Bug Explorer:
The specific reason for each bug is described in bug info: