PMD 3.3 released!

15 Sep 2005

After three months' work, PMD 3.3 is out! The changelog is pretty hefty, so I won't repeat all that here, except to say that there are a bunch of bug fixes and updates and improvements and whatnot. False positives should go down on a couple rules, most notably UnusedPrivateMethod.

There are also seven new rules, including one I like - UnnecessaryLocalBeforeReturn - which finds code like this:

  public class Foo {
    public int foo() {
      int x = doSomething();
      return x;  // instead, just 'return doSomething();'
    }
  }

Thanks to Andriy Rozeluk for suggesting that rule and also providing feedback and test cases for another new rule, UnnecessaryCaseChange, which catches wasteful stuff like:

 public class Foo {
  public boolean bar(String buz) {
    // blah! should be buz.equalsIgnoreCase("baz")
    return buz.toUpperCase().equals("baz");
  }
 }

Thanks also to Peter Frandsen, who wrote two of the new rules in this release.

There are some nice internal improvements to PMD's symbol table which should make writing certain types of rules a lot easier; I'll have to write something up on those some time.