Findbugs is used to locate code bugs;
Installation Method: Go to eclipse marketplace to query findbugs for installation;
Perspective: Findbugs
View: Bug explorer, bug info, bug reviews
Bug explorer is used to display an overview of all errors;
The bug info is used to display the specific information of each bug;
If you want to use findbugs, you only need to right-click the source code interface and find "find bugs" --> "find bugs". Then we can go to findbugs perspective;
The following code is used as 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. inputstream in = new fileinputstream (ARGs [0]); // 2. string comparison bugstring str1 = "ABC"; string [] STR = new string [] {"ABC", "CDE"}; system. out. println (str1.equals (STR ));}}
The following bugs will be found in bug Explorer:
The specific causes of each bug are described in bug info: