Find Bugs in Domino Designer

Yesterday, Christian Güdemann released a plug-in on OpenNTF.org that will give you the Find Bugs plug-in in Domino Designer.

Now, I have never used Find Bugs – but I really like the thought of having code help me improve my own code. I am human – I know that I make mistakes and that there are (still) some things that I do not know. So I decided to try the plug-in minutes after Christian had released it.

Installation

These are the steps to get going:

  1. Open the above link to the project on OpenNTF.org in your IBM Notes browser
  2. Then drag the plugin Screen Shot 2014-01-15 at 09.53.24 to your “My widgets” in the sidebar of IBM Notes
  3. Wait for it to install – and then restart (remember to close Domino Designer first if you have it open)

That’s it. Now the plug-in is installed in Domino Designer.

How to use

Then how do you use it?

  1. Open the Package Explorer (it is ready next to the Domino Designer Database Navigator in the XPages perspective)
  2. Right-click somewhere in the outline of your project (i.e. the database – not your on-disk-project). Select “Find Bugs” which unfolds a small menu
  3. Select “Find Bugs” on the menuScreen Shot 2014-01-09 at 14.24.03
  4. Then nothing happens (unless you follow the progress bar at the lower right corner)
  5. When the progress bar stops running (or before) you can switch to the Find Bugs perspective. Select “Window / Open Perspective / Other…” and locate “FindBugs”
  6. You are now ready to investigate your Java coding errors/warnings

Note:
If you right-click on the title of the database in the Domino Designer Database Navigator then you will suddenly find the Find Bugs menu. This is true for the XPages perspective as well as the Domino Designer perspective:

Screen Shot 2014-01-09 at 23.09.49

 

Here is an example of some code that I have written that was wrong. Tests have not yet tried the particular condition so there is a possibility that I would eventually have ended up shipping the code with this bug.

FindBugs perspective in Domino Designer

In the left side you will see the navigator with the varioous warnings – grouped by how “scary” (!!) they are. If you double-click on a warning you will see the code on the right top side. And at the right corner at the bottom there is a description of the problem discovered.

Now it is up to you to find the best solution to the problem. It took me less than an hour to tidy up a current project with 250+ Java classes. And I even learned a lesson on the way (about cloning the equals() method).

This tool has now become a must-have to improve my Java coding.

As a side note – if there is ever one Java book that you should read, it is Josha Bloch’s Effective Java. Find Bugs help you follow the guidance and rules from this book.

Happy coding!!

2 Responses to Find Bugs in Domino Designer

  1. Excellent info. I used it today as well.
    I also discovered that you also can run FindBugs from the Domino Designer Database navigator.
    Right click on your database and at the bottom you can find FindBugs

    • Frank, you are totally right – I also discovered after having written the article. But it is a little tricky to find in the default outline… I’ll update the article