Recently I have used PMD - a code analyzer tool. It is very useful. You can check for various common coding mistakes in your code. For example an exception is caught and rethrown another exception without including the original excpetion. You detects even duplicate code. You can write your own rules as well. using either as a java class or XPath expression. Pretty cool.