net.sourceforge.pmd.rules.strings
public class ConsecutiveLiteralAppends extends AbstractRule
StringBuffer buf = new StringBuffer(); buf.append("Hello"); buf.append(" ").append("World");This would be more eloquently put as:
StringBuffer buf = new StringBuffer(); buf.append("Hello World");The rule takes one parameter, threshold, which defines the lower limit of consecutive appends before a violation is created. The default is 1.
Method Summary | |
---|---|
Object | visit(ASTVariableDeclaratorId node, Object data) |