01: package org.acm.seguin.pmd.rules;
02:
03: import org.acm.seguin.pmd.AbstractRule;
04: import net.sourceforge.jrefactory.ast.ASTBlockStatement;
05: import net.sourceforge.jrefactory.ast.ASTForStatement;
06: import net.sourceforge.jrefactory.ast.Node;
07:
08: public class StringConcatenationRule extends AbstractRule {
09:
10: public Object visit(ASTForStatement node, Object data) {
11: Node forLoopStmt = null;
12: for (int i = 0; i < 4; i++) {
13: forLoopStmt = node.jjtGetChild(i);
14: if (forLoopStmt instanceof ASTBlockStatement) {
15: break;
16: }
17: }
18: if (forLoopStmt == null) {
19: return data;
20: }
21:
22: return data;
23: }
24: }
|