File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/Manifest.java | File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/Manifest.java | |||
Method name: void write(PrintWriter)
|
Method name: Object clone()
|
|||
Number of AST nodes: 4 | Number of AST nodes: 4 | |||
1 | while (e.hasMoreElements()) {↵ | 1 | while (e.hasMoreElements()) {↵ | |
2 | String sectionName = (String) e.nextElement();↵ | 2 | String key = (String) e.nextElement();↵ | |
3 | Section section = getSection(sectionName);↵ | 3 | ↵ | |
4 | section.write(writer);↵ | |||
4 | Attribute attribute = getAttribute(key);↵ | |||
5 | cloned.storeAttribute(new Attribute(attribute.getName(),↵ | |||
6 | attribute.getValue()));↵ | |||
5 | } | 7 | } | |
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 the same java file |
Number of node comparisons | 16 |
Number of mapped statements | 2 |
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.8 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
12 | while (e.hasMoreElements()) | 4 | while (e.hasMoreElements()) | |||||||||||
13 | String sectionName = (String)e.nextElement(); |
| 5 | String key = (String)e.nextElement(); | ||||||||||
|
| 6 | Attribute attribute = getAttribute(key); | |||||||||||
|
| 7 | cloned.storeAttribute(new Attribute(attribute.getName(), attribute.getValue())); | |||||||||||
14 | Section section = getSection(sectionName); |
| | |||||||||||
15 | section.write(writer); | |
Row | Violation |
---|---|
1 | Unmatched statement Attribute attribute=getAttribute(key); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
2 | Unmatched statement cloned.storeAttribute(new Attribute(attribute.getName(),attribute.getValue())); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
3 | Unmatched statement Section section=getSection(sectionName); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |