File path: /apache-ant-1.7.0/src/org/apache/tools/ant/ComponentHelper.java | File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/junit/XMLJUnitResultFormatter.java | |||
Method name: void initTypes()
|
Method name: void startTestSuite(JUnitTest)
|
|||
Number of AST nodes: 8 | Number of AST nodes: 7 | |||
1 | Enumeration e = props.propertyNames();↵ | |||
1 | while (e.hasMoreElements()) {↵ | 2 | while (e.hasMoreElements()) {↵ | |
2 | String name = (String) e.nextElement();↵ | 3 | String name = (String) e.nextElement();↵ | |
3 | String className = props.getProperty(name);↵ | 4 | ↵ | |
4 | AntTypeDefinition def = new AntTypeDefinition();↵ | |||
5 | def.setName(↵ | 5 | Element propElement = doc.createElement(PROPERTY);↵ | |
6 | name);↵ | 6 | propElement.setAttribute(ATTR_NAME, name);↵ | |
7 | def.setClassName(className);↵ | 7 | ↵ | |
8 | def.setClassLoader(classLoader);↵ | |||
9 | antTypeTable.put(name, def);↵ | |||
8 | propElement.setAttribute(ATTR_VALUE, props.getProperty(name));↵ | |||
9 | propsElement.appendChild(propElement);↵ | |||
10 | } | 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 | 2 |
Number of unmapped statements in the first code fragment | 6 |
Number of unmapped statements in the second code fragment | 5 |
Time elapsed for statement mapping (ms) | 1.7 |
Clone type | Type 3 |
ID | Statement | ID | Statement | ||||
---|---|---|---|---|---|---|---|
| 12 | Enumeration e = props.propertyNames(); | |||||
4 | while (e.hasMoreElements()) | 13 | while (e.hasMoreElements()) | ||||
5 | String name = (String)e.nextElement(); | 14 | String name = (String)e.nextElement(); | ||||
6 | String className = props.getProperty(name); |
| | ||||
7 | AntTypeDefinition def = new AntTypeDefinition(); |
| | ||||
8 | def.setName(name); |
| | ||||
9 | def.setClassName(className); |
| | ||||
10 | def.setClassLoader(classLoader); |
| | ||||
11 | antTypeTable.put(name, def); |
| | ||||
|
| 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 String className=props.getProperty(name); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
2 | Unmatched statement AntTypeDefinition def=new AntTypeDefinition(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
3 | Unmatched statement def.setName(name); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
4 | Unmatched statement def.setClassName(className); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
5 | Unmatched statement def.setClassLoader(classLoader); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
6 | Unmatched statement antTypeTable.put(name,def); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
7 | 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 |
8 | Unmatched statement propElement.setAttribute(ATTR_NAME,name); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
9 | Unmatched statement propElement.setAttribute(ATTR_VALUE,props.getProperty(name)); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |