File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/script/ScriptDefBase.java | File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java | |||
Method name: Object createDynamicElement(String)
|
Method name: Collection executeOrQueue(Enumeration, boolean)
|
|||
Number of AST nodes: 7 | Number of AST nodes: 6 | |||
1 | List nestedElement↵ | 1 | ForkedTestConfiguration c =↵ | |
2 | new ForkedTestConfiguration(test);↵ | |||
2 | List = (List) nestedElementMap.get(name);↵ | 3 | List l = (List) testConfigurations.get(c);↵ | |
3 | if (nestedElementList == null) {↵ | 4 | if (l == null) {↵ | |
4 | nestedElementList = new ArrayList();↵ | 5 | l = new ArrayList();↵ | |
5 | nestedElementMap.put(name, nestedElementList);↵ | 6 | testConfigurations.put(c, l);↵ | |
6 | }↵ | 7 | ↵ | |
7 | Object element = getScript().createNestedElement(name);↵ | 8 | ↵ | |
8 | nestedElementList.add(element);↵ | |||
9 | return element↵ | 9 | }↵ | |
10 | ; | 10 | l.add(test); | |
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 having the same super class |
Number of node comparisons | 17 |
Number of mapped statements | 5 |
Number of unmapped statements in the first code fragment | 2 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 1.8 |
Clone type | Type 3 |
ID | Statement | ID | Statement | ||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
| 7 | ForkedTestConfiguration c = new ForkedTestConfiguration(test); | ||||||||||||||||||||||
1 | List nestedElementList = (List)nestedElementMap.get(name); |
| 8 | List l = (List)testConfigurations.get(c); | |||||||||||||||||||||
2 | if (nestedElementList == null) |
| 9 | if (l == null) | |||||||||||||||||||||
3 | nestedElementList = new ArrayList(); |
| 10 | l = new ArrayList(); | |||||||||||||||||||||
4 | nestedElementMap.put(name, nestedElementList); |
| 11 | testConfigurations.put(c, l); | |||||||||||||||||||||
5 | Object element = getScript().createNestedElement(name); | | |||||||||||||||||||||||
6 | nestedElementList.add(element); |
| 12 | l.add(test); | |||||||||||||||||||||
7 | return element; |
| |
Row | Violation |
---|---|
1 | Unmatched statement ForkedTestConfiguration c=new ForkedTestConfiguration(test); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
2 | Expression l cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Type java.lang.String of variable name does not match with type org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.ForkedTestConfiguration of variable c |
4 | Expression nestedElementList cannot be parameterized, because it has dependencies to/from statements that will be extracted |
5 | Expression l cannot be parameterized, because it has dependencies to/from statements that will be extracted |
6 | Expression nestedElementList cannot be parameterized, because it has dependencies to/from statements that will be extracted |
7 | Expression l cannot be parameterized, because it has dependencies to/from statements that will be extracted |
8 | Type java.lang.String of variable name does not match with type org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.ForkedTestConfiguration of variable c |
9 | Type java.lang.Object of variable element does not match with type org.apache.tools.ant.taskdefs.optional.junit.JUnitTest of variable test |
10 | Expression nestedElementList cannot be parameterized, because it has dependencies to/from statements that will be extracted |
11 | Expression l cannot be parameterized, because it has dependencies to/from statements that will be extracted |
12 | Unmatched return element; |