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 addNodeRecursively(Node, String, Object)
|
Method name: void execute()
|
|||
Number of AST nodes: 5 | Number of AST nodes: 4 | |||
1 | if (node.hasChildNodes()) {↵ | |||
2 | NodeList nodeChildren = node.getChildNodes();↵ | 1 | NodeList topChildren = topElement.getChildNodes();↵ | |
3 | int numChildren = nodeChildren.getLength();↵ | 2 | int numChildren = topChildren.getLength();↵ | |
4 | for (int i = 0; i < numChildren; i++) {↵ | 3 | for (int i = 0; i < numChildren; i++) {↵ | |
5 | // For each child, pass the object added by↵ | 4 | ↵ | |
6 | // processNode to its children -- in other word, each↵ | |||
7 | // object can pass information along to its children.↵ | |||
8 | addNodeRecursively(nodeChildren.item(i), nodePrefix,↵ | 5 | addNodeRecursively(topChildren.item(i), prefix,↵ | |
9 | nodeObject);↵ | 6 | null);↵ | |
10 | }↵ | 7 | ↵ | |
11 | } | 8 |
| |
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 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.4 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
8 | NodeList nodeChildren = node.getChildNodes(); |
| 21 | NodeList topChildren = topElement.getChildNodes(); | |||||||||||||||||
9 | int numChildren = nodeChildren.getLength(); |
| 22 | int numChildren = topChildren.getLength(); | |||||||||||||||||
10 | for (int i = 0; i < numChildren; i++) | 23 | for (int i = 0; i < numChildren; i++) | ||||||||||||||||||
11 | addNodeRecursively(nodeChildren.item(i), nodePrefix, nodeObject); |
| 24 | addNodeRecursively(topChildren.item(i), prefix, null); |
Row | Violation |
---|---|
1 | Type org.w3c.dom.Node of variable node does not match with type org.w3c.dom.Element of variable topElement |