File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/junit/XMLJUnitResultFormatter.java | File path: /apache-ant-1.7.0/src/org/apache/tools/ant/Project.java | |||
Method name: void startTestSuite(JUnitTest)
|
Method name: void setSystemProperties()
|
|||
Number of AST nodes: 8 | Number of AST nodes: 6 | |||
1 | if (props != null) {↵ | |||
2 | ↵ | 1 | Properties systemP = System.getProperties();↵ | |
3 | Enumeration e = props.propertyNames();↵ | 2 | Enumeration e = systemP.propertyNames();↵ | |
4 | while (e.hasMoreElements()) {↵ | 3 | while (e.hasMoreElements()) {↵ | |
5 | String name = (String) e.nextElement();↵ | 4 | String propertyName = (String) e.nextElement();↵ | |
6 | Element propElement = doc.createElement(PROPERTY);↵ | 5 | ↵ | |
7 | propElement.setAttribute(ATTR_NAME, name);↵ | |||
8 | propElement.setAttribute(ATTR_VALUE, prop↵ | 6 | String value = systemP.getProperty(propertyName);↵ | |
9 | s.getProperty(name));↵ | 7 | this.setProperty↵ | |
10 | propsElement.appendChild(propElement);↵ | |||
11 | }↵ | 8 | Internal(propertyName, value);↵ | |
12 | } | 9 |
| |
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 | 26 |
Number of mapped statements | 3 |
Number of unmapped statements in the first code fragment | 4 |
Number of unmapped statements in the second code fragment | 3 |
Time elapsed for statement mapping (ms) | 1.7 |
Clone type | Type 3 |
ID | Statement | ID | Statement | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | Properties systemP = System.getProperties(); | ||||||||||||
12 | Enumeration e = props.propertyNames(); |
| 2 | Enumeration e = systemP.propertyNames(); | ||||||||||
13 | while (e.hasMoreElements()) | 3 | while (e.hasMoreElements()) | |||||||||||
14 | String name = (String)e.nextElement(); |
| 4 | String propertyName = (String)e.nextElement(); | ||||||||||
|
| 5 | String value = systemP.getProperty(propertyName); | |||||||||||
|
| 6 | this.setPropertyInternal(propertyName, value); | |||||||||||
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 value=systemP.getProperty(propertyName); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
2 | Unmatched statement this.setPropertyInternal(propertyName,value); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
3 | 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 |
4 | 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 |
5 | 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 |