File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/XMLValidateTask.java | File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/XMLValidateTask.java | |||
Method name: void initValidator()
|
Method name: void initValidator()
|
|||
Number of AST nodes: 3 | Number of AST nodes: 3 | |||
1 | for (int i = 0; i < propertyList.size(); i++) {↵ | 1 | for (int i = 0; i < attributeList.size(); i++) {↵ | |
2 | final Property prop = (Property) propertyList.elementAt(i);↵ | 2 | Attribute feature = (Attribute) attributeList.elementAt(i);↵ | |
3 | setProperty(prop.getName(), prop.getValue());↵ | 3 | setFeature(feature.getName(), feature.getValue());↵ | |
4 | } | 4 |
| |
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 the same method |
Number of node comparisons | 10 |
Number of mapped statements | 1 |
Number of unmapped statements in the first code fragment | 2 |
Number of unmapped statements in the second code fragment | 2 |
Time elapsed for statement mapping (ms) | 2.0 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
10 | for (int i = 0; i < propertyList.size(); i++) |
| 7 | for (int i = 0; i < attributeList.size(); i++) | ||||||||||
|
| 8 | Attribute feature = (Attribute)attributeList.elementAt(i); | |||||||||||
|
| 9 | setFeature(feature.getName(), feature.getValue()); | |||||||||||
11 | final Property prop = (Property)propertyList.elementAt(i); |
| | |||||||||||
12 | setProperty(prop.getName(), prop.getValue()); |
| |
Row | Violation |
---|---|
1 | Unmatched statement Attribute feature=(Attribute)attributeList.elementAt(i); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
2 | Unmatched statement setFeature(feature.getName(),feature.getValue()); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted |
3 | Unmatched statement final Property prop=(Property)propertyList.elementAt(i); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
4 | Unmatched statement setProperty(prop.getName(),prop.getValue()); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted |
5 | The refactoring of the clones is infeasible, because the number of macthed statements is equal to zero |