FindBugs In Eclipse Tutorial

Now, Build the project using Project->Build Project. Right click on the project, and run the FindBugs according to following screenshot.

Running FindBugs

Now you can see a bug mark on the source code, double click the bug mark, Bug Explorer will be shown ( You can also navigate to Window->Show View->Other->FindBugs->Bug Explorer).

FindBugs Properties

From properties tab, You can get more detailed description about this bug(See the below screenshot).

You can enable properties tab by navigating to Window->Show View->Properties.

Findbugs Properties

FindBugs Helps You To Avoid Bad Code

There is always have possibilities for bugs on agile written code.
Here are some examples in which FindBugs helps you to avoid bad or malicious code.

//String is immutable, so invoking a method on a immutable object, will not update the object

String str = "Javatips.net       ";
str.trim
();
//Static field can be accessed and changed by malicious code or by an accident, so it should be declared as final

public static byte FIND_FLAG = 0;




Previous 1 2








4 Responses to "FindBugs In Eclipse Tutorial"
  1. JGuru 2011-09-21 18:55:57.0
  1. admin 2011-09-22 14:55:27.0
  1. dongjun 2011-09-23 12:55:58.0
  1. padma naresh 2011-09-24 18:35:37.0

Your email address will not be published. Required fields are marked *