NodeList nodeChildren = node.getChildNodes();
int numChildren = nodeChildren.getLength();
for (int i = 0; i < numChildren; i++) {
// For each child, pass the object added by
// processNode to its children -- in other word, each
// object can pass information along to its children.
addNodeRecursively(nodeChildren.item(i), nodePrefix,
nodeObject);
}
for (int i = 0; i < childDirectories.size(); i++) {
Directory current = (Directory) childDirectories.get(i);
if (current.getDirectory().equals(dir)) {
return current;
}
}
Clone fragments detected by clone detection tool
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/optional/ssh/Directory.java
|
Method name: void addNodeRecursively(Node, String, Object)
|
|
Method name: Directory getChild(File)
|
Number of AST nodes: 4
|
|
Number of AST nodes: 4
|
|
1 | NodeList nodeChildren = node.getChildNodes();↵ | | |
|
2 | int numChildren = nodeChildren.getLength();↵ | | |
|
|
3 | for (int i = 0; i < numChildren; i++) {↵ | | 1 | for (int i = 0; i < ↵
|
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.↵ | | |
|
7 | addNodeRecursively(nodeChildren.item(i), nodePrefix,↵ | | |
|
8 | nodeObject);↵ | | |
|
9 | ↵ | | 2 | childDirectories.size(); i++) {↵
|
| | | 3 | Directory current = (Directory) childDirectories.get(i);↵
|
| | | 4 | if (current.getDirectory().equals(dir)) {↵
|
| | | 5 | return current;↵
|
| | | 6 | }↵
|
10 | } | | 7 | }
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 0 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.0 |
Clones location | Clones are in different classes |
Number of node comparisons | 1 |