File path: /apache-ant-1.7.0/src/org/apache/tools/ant/helper/AntXMLContext.java | File path: /apache-ant-1.7.0/src/org/apache/tools/ant/util/DOMElementWriter.java | |||
Method name: void startPrefixMapping(String, String)
|
Method name: void addNSDefinition(Element, String)
|
|||
Number of AST nodes: 5 | Number of AST nodes: 5 | |||
1 | List list = (List) prefixMapping.get(prefix);↵ | 1 | ArrayList al = (ArrayList) nsURIByElement.get(element);↵ | |
2 | if (list == null) {↵ | 2 | if (al == null) {↵ | |
3 | list = new ArrayList();↵ | 3 | al = new ArrayList();↵ | |
4 | prefixMapping.put(prefix, list);↵ | 4 | nsURIByElement.put(element, al);↵ | |
5 | }↵ | 5 | }↵ | |
6 | list.add(uri); | 6 | 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 | 13 |
Number of mapped statements | 3 |
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.7 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | ArrayList al = (ArrayList)nsURIByElement.get(element); | |||||||||||||||||||||||
1 | List list = (List)prefixMapping.get(prefix); | | |||||||||||||||||||||||
2 | if (list == null) |
| 2 | if (al == null) | |||||||||||||||||||||
|
| 3 | al = new ArrayList(); | ||||||||||||||||||||||
3 | list = new ArrayList(); |
| | ||||||||||||||||||||||
4 | prefixMapping.put(prefix, list); |
| 4 | nsURIByElement.put(element, al); | |||||||||||||||||||||
5 | list.add(uri); |
| 5 | al.add(uri); |
Row | Violation |
---|---|
1 | Type java.util.List of variable list does not match with type java.util.ArrayList of variable al |
2 | Unmatched statement al=new ArrayList(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
3 | Unmatched statement list=new ArrayList(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
4 | Type java.lang.String of variable prefix does not match with type org.w3c.dom.Element of variable element |
5 | Type java.util.Map of variable prefixMapping does not match with type java.util.HashMap of variable nsURIByElement |
6 | Type java.util.List of variable list does not match with type java.util.ArrayList of variable al |