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 < attributeList.size(); i++) {↵ | 1 | for (int i = 0; i < propertyList.size(); i++) {↵ | |
2 | Attribute feature = (Attribute) attributeList.elementAt(i);↵ | 2 | final Property prop = (Property) propertyList.elementAt(i);↵ | |
3 | setFeature(feature.getName(), feature.getValue());↵ | 3 | setProperty(prop.getName(), prop.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) | 0.5 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
7 | for (int i = 0; i < attributeList.size(); i++) |
| 10 | for (int i = 0; i < propertyList.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 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 |