File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/depend/Depend.java | File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java | |||
Method name: void determineDependencies()
|
Method name: Collection executeOrQueue(Enumeration, boolean)
|
|||
Number of AST nodes: 7 | Number of AST nodes: 6 | |||
1 | while (depEnum.hasMoreElements()) {↵ | |||
2 | String dependentClass = (String) depEnum.nextElement(↵ | 1 | ForkedTestConfiguration c =↵ | |
3 | );↵ | 2 | new ForkedTestConfiguration(test);↵ | |
4 | Hashtable affectedClasses↵ | 3 | ↵ | |
5 | = (Hashtable) affectedClassMap.get(dependentClass);↵ | |||
4 | List l = (List) testConfigurations.get(c);↵ | |||
6 | if (affectedClasses == null) {↵ | 5 | if (l == null) {↵ | |
7 | affectedClasses = new Hashtable();↵ | 6 | ↵ | |
8 | affectedClassMap.put(dependentClass, affectedClasses↵ | 7 | l = new ArrayList();↵ | |
9 | );↵ | 8 | testConfigurations.put(c, l);↵ | |
10 | }↵ | 9 | ↵ | |
10 | }↵ | |||
11 | affectedClasses.put(info.className, info);↵ | 11 | ↵ | |
12 | } | 12 |
| |
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 | 19 |
Number of mapped statements | 2 |
Number of unmapped statements in the first code fragment | 4 |
Number of unmapped statements in the second code fragment | 4 |
Time elapsed for statement mapping (ms) | 1.7 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
| 7 | ForkedTestConfiguration c = new ForkedTestConfiguration(test); | ||||||||||||||||||||||
|
| 8 | List l = (List)testConfigurations.get(c); | ||||||||||||||||||||||
| 12 | l.add(test); | |||||||||||||||||||||||
36 | String dependentClass = (String)depEnum.nextElement(); |
| | ||||||||||||||||||||||
37 | Hashtable affectedClasses = (Hashtable)affectedClassMap.get(dependentClass); |
| | ||||||||||||||||||||||
38 | if (affectedClasses == null) |
| 9 | if (l == null) | |||||||||||||||||||||
|
| 10 | l = new ArrayList(); | ||||||||||||||||||||||
39 | affectedClasses = new Hashtable(); |
| | ||||||||||||||||||||||
40 | affectedClassMap.put(dependentClass, affectedClasses); |
| 11 | testConfigurations.put(c, l); | |||||||||||||||||||||
41 | affectedClasses.put(info.className, info); | |
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 | Unmatched statement List l=(List)testConfigurations.get(c); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
3 | Unmatched statement String dependentClass=(String)depEnum.nextElement(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
4 | Unmatched statement Hashtable affectedClasses=(Hashtable)affectedClassMap.get(dependentClass); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
5 | Type java.util.Hashtable of variable affectedClasses does not match with type java.util.List of variable l |
6 | Unmatched statement l=new ArrayList(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
7 | Unmatched statement affectedClasses=new Hashtable(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
8 | Type java.lang.String of variable dependentClass does not match with type org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.ForkedTestConfiguration of variable c |
9 | Type java.util.Hashtable of variable affectedClassMap does not match with type java.util.Map of variable testConfigurations |