This post originated from an RSS feed registered with Java Buzz
by Joe Shelby.
Original Post: Bugs I'm Tired of Seeing
Feed Title: Joe's Java Jottings
Feed URL: http://www.blog-city.com/bc/
Feed Description: Notes, observations, and occasional other stuff on Java, with concentrations on Swing, XML, and the Semantic (Object) Web.
System.out.println(someObject.toString());
Ugh. 1) redundant. 2) buggy. serious codesmell (tm)
why is it buggy? if someObject is null, you have NullPointerException. if you didn't have the toString() call, println() would safely print null for you.
I'm gonna fidget with PMD's syntax and see if I can make a rule for it.