net.sourceforge.pmd.rules.strings
public class InefficientEmptyStringCheck extends AbstractRule
if(str.trim().length()==0){....is quite inefficient as trim() causes a new String to be created. Smarter code to check for an empty string would be:
Character.isWhitespace(str.charAt(i));
Method Summary | |
---|---|
Object | visit(ASTVariableDeclaratorId node, Object data) |