File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/XmlProperty.java | File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/XmlProperty.java | |||
Method name: void execute()
|
Method name: void addNodeRecursively(Node, String, Object)
|
|||
Number of AST nodes: 4 | Number of AST nodes: 4 | |||
1 | NodeList topChildren = topElement.getChildNodes();↵ | 1 | NodeList nodeChildren = node.getChildNodes();↵ | |
2 | int numChildren = topChildren.getLength();↵ | 2 | int numChildren = nodeChildren.getLength();↵ | |
3 | ↵ | |||
4 | for (int i = 0; i < numChildren; i++) {↵ | 3 | for (int i = 0; i < numChildren; i++) {↵ | |
5 | ↵ | 4 | // For each child, pass the object added by↵ | |
5 | // processNode to its children -- in other word, each↵ | |||
6 | // object can pass information along to its children.↵ | |||
6 | addNodeRecursively(topChildren.item(i), prefix, null);↵ | 7 | addNodeRecursively(nodeChildren.item(i), nodePrefix,↵ | |
7 | ↵ | 8 | nodeObject);↵ | |
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.1 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 8 |
Number of mapped statements | 4 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 1.2 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
21 | NodeList topChildren = topElement.getChildNodes(); |
| 8 | NodeList nodeChildren = node.getChildNodes(); | |||||||||||||||||
22 | int numChildren = topChildren.getLength(); |
| 9 | int numChildren = nodeChildren.getLength(); | |||||||||||||||||
23 | for (int i = 0; i < numChildren; i++) | 10 | for (int i = 0; i < numChildren; i++) | ||||||||||||||||||
24 | addNodeRecursively(topChildren.item(i), prefix, null); |
| 11 | addNodeRecursively(nodeChildren.item(i), nodePrefix, nodeObject); |
Row | Violation |
---|---|
1 | Type org.w3c.dom.Element of variable topElement does not match with type org.w3c.dom.Node of variable node |