File path: /apache-ant-1.7.0/src/org/apache/tools/ant/util/DOMUtils.java | File path: /apache-ant-1.7.0/src/org/apache/tools/ant/util/DOMUtils.java | |||
Method name: Element createChildElement(Element, String)
|
Method name: void appendCDATA(Element, String)
|
|||
Number of AST nodes: 4 | Number of AST nodes: 3 | |||
1 | Document doc = parent.getOwnerDocument();↵ | 1 | Document doc = parent.getOwnerDocument();↵ | |
2 | Element e = doc.createElement(name);↵ | 2 | CDATASection c = doc.createCDATASection(content);↵ | |
3 | parent.appendChild(e);↵ | 3 | parent.appendChild(c); | |
4 | return e; | |||
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.0 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 12 |
Number of mapped statements | 2 |
Number of unmapped statements in the first code fragment | 2 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 0.0 |
Clone type | Type 3 |
ID | Statement | ID | Statement | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | Document doc = parent.getOwnerDocument(); | 1 | Document doc = parent.getOwnerDocument(); | |||||||||||||||
|
| 2 | CDATASection c = doc.createCDATASection(content); | |||||||||||||||
2 | Element e = doc.createElement(name); |
| | |||||||||||||||
3 | parent.appendChild(e); |
| 3 | parent.appendChild(c); | ||||||||||||||
4 | return e; |
| |
Row | Violation |
---|---|
1 | Unmatched statement CDATASection c=doc.createCDATASection(content); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
2 | Unmatched statement Element e=doc.createElement(name); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
3 | Type org.w3c.dom.Element of variable e does not match with type org.w3c.dom.CDATASection of variable c |
4 | Unmatched return e; |