Andriy Rozeluk found another case for PMD to catch; the RFE is here. Here's a code sample:
This is bad because StringBuffer.toString()
creates a new String
object which gets thrown away immediately after the equals('')
check. Blah!
What other wasteful method chaining idioms are out there that PMD could catch?