Showing posts with label Tools. Show all posts
Showing posts with label Tools. Show all posts

Tuesday, July 7, 2009

Find Bugs

Find Bugs is an eclipse plugin which shows the common errors in Java. I use the eclipse plugin, and as a Best Practice for java developers this should be used while development. :)

e.g.
For a piece of code the following error was received

When piece of code in given below:-
1. Long id = request.getId();
2.
3. if(request == null || id == null) {
4. throw new RuntimeException("id cannot be null");
5. }
Find the error if you can... :)

The check for request == null is fruitless, since if request is null the line 1 will fail. Below is provided the corrected code and thus removes the bug.
1. if(request == null || request.getId() == null) {
2. throw new RuntimeException("id cannot be null");
3. }

Long id = request.getId();


A note of caution, the code inspection tools need to be used intelligently, it may sometimes flag code as bug that may have been done for some valid reason. Ignore them in this case.

Tuesday, June 30, 2009

Minimize memory footprint

An application to minimize memory footprint.

Minimem

The application can optimize the memory used. Some applications when run over a long time start hogging a lot of memory, this tools optimizes the memory usage and free it.

Mozilla is a good example of such a process (at least I was facing the issue) but is irreplaceable. :)

Tuesday, June 16, 2009

A very nice regular expression tool

This a very useful regular expression verification tool.

Regex Coach

I haven't tried many but never needed to look further.