|
1 |
| |
|
2 |
| |
|
3 |
| |
|
4 |
| package net.sourceforge.pmd.rules; |
|
5 |
| |
|
6 |
| import net.sourceforge.pmd.AbstractRule; |
|
7 |
| import net.sourceforge.pmd.ast.ASTBlockStatement; |
|
8 |
| import net.sourceforge.pmd.ast.ASTForStatement; |
|
9 |
| import net.sourceforge.pmd.ast.Node; |
|
10 |
| |
|
11 |
| public class StringConcatenationRule extends AbstractRule { |
|
12 |
| |
|
13 |
0
| public Object visit(ASTForStatement node, Object data) {
|
|
14 |
0
| Node forLoopStmt = null;
|
|
15 |
0
| for (int i = 0; i < 4; i++) {
|
|
16 |
0
| forLoopStmt = node.jjtGetChild(i);
|
|
17 |
0
| if (forLoopStmt instanceof ASTBlockStatement) {
|
|
18 |
0
| break;
|
|
19 |
| } |
|
20 |
| } |
|
21 |
0
| if (forLoopStmt == null) {
|
|
22 |
0
| return data;
|
|
23 |
| } |
|
24 |
| |
|
25 |
| |
|
26 |
0
| return data;
|
|
27 |
| } |
|
28 |
| } |