File path: /apache-ant-1.7.0/src/org/apache/tools/ant/types/selectors/ContainsRegexpSelector.java | File path: /apache-ant-1.7.0/src/org/apache/tools/ant/types/selectors/TypeSelector.java | |||
Method name: void setParameters(Parameter[])
|
Method name: void setParameters(Parameter[])
|
|||
Number of AST nodes: 5 | Number of AST nodes: 6 | |||
1 | for (int i = 0; i < parameters.length; i++) {↵ | |||
2 | String paramname = parameters[i].getName();↵ | 1 | String paramname = parameters[i].getName();↵ | |
3 | if (EXPRESSION_KEY.equalsIgnoreCase(paramname)) {↵ | 2 | if (TYPE_KEY.equalsIgnoreCase(paramname)) {↵ | |
4 | setExpression(parameters[i].getValue()↵ | 3 | FileType t = new FileType();↵ | |
4 | t.setValue(parameters[i].getValue());↵ | |||
5 | );↵ | 5 | setType(t);↵ | |
6 | } else {↵ | 6 | } else {↵ | |
7 | setError("Invalid parameter " + paramname);↵ | 7 | setError("Invalid parameter " + paramname);↵ | |
8 | }↵ | 8 |
| |
9 | } | |||
See real code fragment | See real code fragment |
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 1 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.2 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 17 |
Number of mapped statements | 4 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 2 |
Time elapsed for statement mapping (ms) | 1.1 |
Clone type | Type 3 |
ID | Statement | ID | Statement | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
4 | String paramname = parameters[i].getName(); | 4 | String paramname = parameters[i].getName(); | ||||||||||||||||||
5 | if (EXPRESSION_KEY.equalsIgnoreCase(paramname)) |
| 5 | if (TYPE_KEY.equalsIgnoreCase(paramname)) | |||||||||||||||||
|
| 6 | FileType t = new FileType(); | ||||||||||||||||||
6 | setExpression(parameters[i].getValue()); |
| 7 | t.setValue(parameters[i].getValue()); | |||||||||||||||||
|
| 8 | setType(t); | ||||||||||||||||||
else | else | ||||||||||||||||||||
7 | setError("Invalid parameter " + paramname); | 9 | setError("Invalid parameter " + paramname); |
Row | Violation |
---|---|
1 | Unmatched statement FileType t=new FileType(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
2 | Expression setExpression(parameters[i].getValue()) is a void method call, and thus it cannot be parameterized |
3 | Expression t.setValue(parameters[i].getValue()) is a void method call, and thus it cannot be parameterized |
4 | Expression setExpression(parameters[i].getValue()) is a void method call, and thus it cannot be parameterized |
5 | Expression t.setValue(parameters[i].getValue()) is a void method call, and thus it cannot be parameterized |
6 | Unmatched statement setType(t); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |