Class UseStringBufferForStringAppendsRule

java.lang.Object
net.sourceforge.pmd.properties.AbstractPropertySource
net.sourceforge.pmd.lang.rule.AbstractRule
net.sourceforge.pmd.lang.java.rule.AbstractJavaRule
net.sourceforge.pmd.lang.java.rule.AbstractJavaRulechainRule
net.sourceforge.pmd.lang.java.rule.performance.UseStringBufferForStringAppendsRule
All Implemented Interfaces:
net.sourceforge.pmd.lang.ast.AstVisitor, JavaVisitor, net.sourceforge.pmd.lang.rule.Rule, net.sourceforge.pmd.properties.PropertySource

public class UseStringBufferForStringAppendsRule extends AbstractJavaRulechainRule
  • Constructor Details

    • UseStringBufferForStringAppendsRule

      public UseStringBufferForStringAppendsRule()
  • Method Details

    • visit

      public Object visit(ASTVariableId node, Object data)
      This method is used to check whether user appends string directly instead of using StringBuffer or StringBuilder
      Parameters:
      node - This is the expression of part of java code to be checked.
      data - This is the data to return.
      Returns:
      Object This returns the data passed in. If violation happens, violation is added to data.