A couple of years ago I was impressed by the code analyzer feature in Oracle’s JDeveloper – it checked you code for unused variables, infinite loops etc – a useful utility to get a sceond opinion on your code (although never a replacement for a code review with other experienced developers).
The FindBugs project on SourceForge is a similar utility. Looks like it finds an impressive range of different bugs and areas for optimization.