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/optional/depend/Depend.java | |||
Method name: Object clone()
|
Method name: void dumpDependencies()
|
|||
Number of AST nodes: 4 | Number of AST nodes: 4 | |||
1 | while (e.hasMoreElements()) {↵ | 1 | while (affectedClassEnum.hasMoreElements()) {↵ | |
2 | String key = (String) e.nextElement();↵ | 2 | String ↵ | |
3 | Attribute attribute = getAttribute(key);↵ | |||
4 | cloned.storeAttribute(new Attribute(attribute.getName(),↵ | 3 | affectedClass = (String) affectedClassEnum.nextElement();↵ | |
4 | ClassFileInfo info↵ | |||
5 | = (ClassFileInfo) affectedClasses.get(affectedClass);↵ | |||
5 | ↵ | 6 | log(" " + affectedClass + " in "↵ | |
6 | attribute.getValue()));↵ | 7 | + info.absoluteFile.getPath(), Project.MSG_DEBUG);↵ | |
7 | } | 8 |
| |
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 | 17 |
Number of mapped statements | 3 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 1.6 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
4 | while (e.hasMoreElements()) |
| 8 | while (affectedClassEnum.hasMoreElements()) | ||||||||||||||||||||||||
5 | String key = (String)e.nextElement(); |
| 9 | String affectedClass = (String)affectedClassEnum.nextElement(); | ||||||||||||||||||||||||
6 | Attribute attribute = getAttribute(key); |
| | |||||||||||||||||||||||||
|
| 10 | ClassFileInfo info = (ClassFileInfo)affectedClasses.get(affectedClass); | |||||||||||||||||||||||||
7 | cloned.storeAttribute(new Attribute(attribute.getName(), attribute.getValue())); |
| 11 | log(" " + affectedClass + " in " + info.absoluteFile.getPath(), Project.MSG_DEBUG); |
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 ClassFileInfo info=(ClassFileInfo)affectedClasses.get(affectedClass); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
3 | Expression cloned.storeAttribute(new Attribute(attribute.getName(),attribute.getValue())) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Expression log(" " + affectedClass + " in "+ info.absoluteFile.getPath(),Project.MSG_DEBUG) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
5 | Expression cloned.storeAttribute(new Attribute(attribute.getName(),attribute.getValue())) is a void method call, and thus it cannot be parameterized |
6 | Expression log(" " + affectedClass + " in "+ info.absoluteFile.getPath(),Project.MSG_DEBUG) is a void method call, and thus it cannot be parameterized |
7 | Expression cloned.storeAttribute(new Attribute(attribute.getName(),attribute.getValue())) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
8 | Expression log(" " + affectedClass + " in "+ info.absoluteFile.getPath(),Project.MSG_DEBUG) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
9 | Expression cloned.storeAttribute(new Attribute(attribute.getName(),attribute.getValue())) is a void method call, and thus it cannot be parameterized |
10 | Expression log(" " + affectedClass + " in "+ info.absoluteFile.getPath(),Project.MSG_DEBUG) is a void method call, and thus it cannot be parameterized |