Java News from Thursday, March 30, 2006

I just committed a few minor changes to Jaxen and unexpectedly got some nicely syntax colored diffs back in my email. On further investigation this seems to be produced by a new product called CVSspam. Despite the hideous name this actually looks like a nice product, mostly because the mails it sends out are a lot more informative than the typical CVS commit message that I usually just ignore. CVSspam is published under the GPL.

Tom Copeland has released PMD 3.6, an open source tool for automatically checking Java code for various classes of bugs. Version 3.6 can now check checking JSP/JSF pages. It also adds five new rules: AvoidThreadGroup, UnsynchronizedStaticDateFormatter, InefficientEmptyStringCheck, InsufficientStringBufferDeclaration, and SimplifyBooleanAssertion. He also implemented a feature I'd suggested for rulesets with only the new rules. I used this to test out the five new rules on XOM.

The InsufficientStringBufferDeclaration found several method calls I could improve (and a couple of false positives as well). Its error messages look like. "StringBuffer constructor is initialized with size 16, but has 27 characters appended". I'm not sure how big a difference fixing this will make, but it can't hurt. The SimplifyBooleanAssertion test found a whole bunch of places I was doing assertTrue(!expr) instead of assertFalse(expr) and assertTrue(a != b) instead of assertNotSame(a, b).

The Apache Software Foundation has released of Maven 2.0.3, an open source build tool for Java that's more declarative and less procedural than Ant. This is mostly a bug fix release.