File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/unix/Symlink.java | File path: /apache-ant-1.7.0/src/org/apache/tools/ant/util/DOMElementWriter.java | |||
Method name: void record()
|
Method name: void addNSDefinition(Element, String)
|
|||
Number of AST nodes: 7 | Number of AST nodes: 5 | |||
1 | File thisLink = (File) litr.next();↵ | |||
2 | File parent = thisLink.getParentFile();↵ | |||
3 | Vector v = (Vector) byDir.get(parent);↵ | 1 | ArrayList al = (ArrayList) nsURIByElement.get(element);↵ | |
4 | if (v == null) {↵ | 2 | if (al == null) {↵ | |
5 | v = new Vector();↵ | 3 | ↵ | |
6 | byDir↵ | 4 | al = new ArrayList();↵ | |
7 | .put(parent, v);↵ | 5 | nsURIByElement.put(element, al);↵ | |
8 | }↵ | 6 | ↵ | |
9 | v.addElement(thisLink↵ | 7 | }↵ | |
10 | ); | 8 | al.add(uri); | |
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 in different classes |
Number of node comparisons | 17 |
Number of mapped statements | 3 |
Number of unmapped statements in the first code fragment | 4 |
Number of unmapped statements in the second code fragment | 2 |
Time elapsed for statement mapping (ms) | 1.8 |
Clone type | Type 3 |
ID | Statement | ID | Statement | ||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | ArrayList al = (ArrayList)nsURIByElement.get(element); | |||||||||||||||||||||||
| 5 | al.add(uri); | |||||||||||||||||||||||
10 | File thisLink = (File)litr.next(); | | |||||||||||||||||||||||
11 | File parent = thisLink.getParentFile(); |
| | ||||||||||||||||||||||
12 | Vector v = (Vector)byDir.get(parent); |
| | ||||||||||||||||||||||
13 | if (v == null) |
| 2 | if (al == null) | |||||||||||||||||||||
14 | v = new Vector(); |
| 3 | al = new ArrayList(); | |||||||||||||||||||||
15 | byDir.put(parent, v); |
| 4 | nsURIByElement.put(element, al); | |||||||||||||||||||||
16 | v.addElement(thisLink); | |
Row | Violation |
---|---|
1 | Unmatched statement File parent=thisLink.getParentFile(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
2 | Unmatched statement Vector v=(Vector)byDir.get(parent); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
3 | Type java.io.File of variable parent does not match with type org.w3c.dom.Element of variable element |
4 | Type java.util.Hashtable of variable byDir does not match with type java.util.HashMap of variable nsURIByElement |
5 | Clone fragment #1 returns variable v with type java.util.Vector , while Clone fragment #2 returns variable al with type java.util.ArrayList |