View Javadoc

    1   /**
    2    * BSD-style license; for more info see http://pmd.sourceforge.net/license.html
    3    */
    4   package net.sourceforge.pmd.lang.java.rule;
    5
    6   import net.sourceforge.pmd.lang.ast.Node;
    7   import net.sourceforge.pmd.lang.java.ast.ASTBlockStatement;
    8   import net.sourceforge.pmd.lang.java.ast.ASTForStatement;
    9
    10  //FUTURE This is not referenced by any RuleSet?
    11  public class StringConcatenationRule extends AbstractJavaRule {
    12
    13      public Object visit(ASTForStatement node, Object data) {
    14          Node forLoopStmt = null;
    15          for (int i = 0; i < 4; i++) {
    16              forLoopStmt = node.jjtGetChild(i);
    17              if (forLoopStmt instanceof ASTBlockStatement) {
    18                  break;
    19              }
    20          }
    21          if (forLoopStmt == null) {
    22              return data;
    23          }
    24
    25
    26          return data;
    27      }
    28  }