01: /**
02: * BSD-style license; for more info see http://pmd.sourceforge.net/license.html
03: */package net.sourceforge.pmd.rules;
04:
05: import net.sourceforge.pmd.AbstractRule;
06: import net.sourceforge.pmd.ast.ASTBlockStatement;
07: import net.sourceforge.pmd.ast.ASTForStatement;
08: import net.sourceforge.pmd.ast.Node;
09:
10: public class StringConcatenationRule extends AbstractRule {
11:
12: public Object visit(ASTForStatement node, Object data) {
13: Node forLoopStmt = null;
14: for (int i = 0; i < 4; i++) {
15: forLoopStmt = node.jjtGetChild(i);
16: if (forLoopStmt instanceof ASTBlockStatement) {
17: break;
18: }
19: }
20: if (forLoopStmt == null) {
21: return data;
22: }
23:
24: return data;
25: }
26: }
|