File path: /apache-ant-1.7.0/src/org/apache/tools/ant/Task.java | File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/junit/XMLJUnitResultFormatter.java | |||
Method name: void replaceChildren(RuntimeConfigurable, UnknownElement)
|
Method name: void startTestSuite(JUnitTest)
|
|||
Number of AST nodes: 8 | Number of AST nodes: 7 | |||
1 | while (e.hasMoreElements()) {↵ | |||
2 | RuntimeConfigurable childWrapper =↵ | |||
3 | (RuntimeConfigurable↵ | 1 | Enumeration e = props.propertyNames();↵ | |
2 | while (e.hasMoreElements()) {↵ | |||
4 | ) e.nextElement();↵ | 3 | String name = (String) e.nextElement();↵ | |
5 | UnknownElement childElement =↵ | 4 | Element propElement =↵ | |
6 | new UnknownElement(childWrapper.getElementTag());↵ | |||
7 | parentElement.addChild(childElement);↵ | |||
8 | childElement.setProject(getProject()↵ | 5 | doc.createElement(PROPERTY);↵ | |
9 | );↵ | 6 | propElement.setAttribute(ATTR_NAME, name);↵ | |
10 | childElement.setRuntimeConfigurableWrapper(childWrapper);↵ | 7 | propElement.set↵ | |
11 | childWrapper.setProxy(childElement);↵ | |||
12 | replaceChildren(childWrapper, child↵ | 8 | Attribute(ATTR_VALUE, props.getProperty(name));↵ | |
13 | Element);↵ | 9 | propsElement.appendChild(propElement);↵ | |
14 | } | 10 | } | |
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 | 48 |
Number of mapped statements | 1 |
Number of unmapped statements in the first code fragment | 7 |
Number of unmapped statements in the second code fragment | 6 |
Time elapsed for statement mapping (ms) | 1.5 |
Clone type | Type 3 |
ID | Statement | ID | Statement | ||||
---|---|---|---|---|---|---|---|
| 12 | Enumeration e = props.propertyNames(); | |||||
2 | while (e.hasMoreElements()) | 13 | while (e.hasMoreElements()) | ||||
3 | RuntimeConfigurable childWrapper = (RuntimeConfigurable)e.nextElement(); |
| | ||||
4 | UnknownElement childElement = new UnknownElement(childWrapper.getElementTag()); |
| | ||||
5 | parentElement.addChild(childElement); |
| | ||||
6 | childElement.setProject(getProject()); |
| | ||||
7 | childElement.setRuntimeConfigurableWrapper(childWrapper); |
| | ||||
8 | childWrapper.setProxy(childElement); |
| | ||||
9 | replaceChildren(childWrapper, childElement); |
| | ||||
|
| 14 | String name = (String)e.nextElement(); | ||||
|
| 15 | Element propElement = doc.createElement(PROPERTY); | ||||
| 16 | propElement.setAttribute(ATTR_NAME, name); | |||||
| 17 | propElement.setAttribute(ATTR_VALUE, props.getProperty(name)); | |||||
| 18 | propsElement.appendChild(propElement); |
Row | Violation |
---|---|
1 | Unmatched statement RuntimeConfigurable childWrapper=(RuntimeConfigurable)e.nextElement(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
2 | Unmatched statement UnknownElement childElement=new UnknownElement(childWrapper.getElementTag()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
3 | Unmatched statement parentElement.addChild(childElement); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
4 | Unmatched statement childElement.setProject(getProject()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
5 | Unmatched statement childElement.setRuntimeConfigurableWrapper(childWrapper); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
6 | Unmatched statement childWrapper.setProxy(childElement); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
7 | Unmatched statement replaceChildren(childWrapper,childElement); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
8 | Unmatched statement String name=(String)e.nextElement(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
9 | Unmatched statement Element propElement=doc.createElement(PROPERTY); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |