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/unix/Symlink.java | |||
Method name: void determineDependencies()
|
Method name: void record()
|
|||
Number of AST nodes: 4 | Number of AST nodes: 4 | |||
1 | Hashtable affectedClasses↵ | |||
2 | = (Hashtable) affectedClassMap.get(dependentClass);↵ | 1 | Vector v = (Vector) byDir.get(parent);↵ | |
3 | if (affectedClasses == null) {↵ | 2 | if (v == null) {↵ | |
4 | affectedClasses = new Hashtable();↵ | 3 | v = new Vector();↵ | |
5 | affectedClassMap.put(dependentClass, affectedClasses);↵ | 4 | byDir.put(parent, v);↵ | |
6 | } | 5 |
| |
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) | 1.2 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 11 |
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) | 6.9 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
| 12 | Vector v = (Vector)byDir.get(parent); | |||||||||||||||||||||||||
37 | Hashtable affectedClasses = (Hashtable)affectedClassMap.get(dependentClass); |
| | |||||||||||||||||||||||||
38 | if (affectedClasses == null) |
| 13 | if (v == null) | ||||||||||||||||||||||||
|
| 14 | v = new Vector(); | |||||||||||||||||||||||||
39 | affectedClasses = new Hashtable(); |
| | |||||||||||||||||||||||||
40 | affectedClassMap.put(dependentClass, affectedClasses); |
| 15 | byDir.put(parent, v); |
Row | Violation |
---|---|
1 | Unmatched statement Vector v=(Vector)byDir.get(parent); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
2 | 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 |
3 | Type java.util.Hashtable of variable affectedClasses does not match with type java.util.Vector of variable v |
4 | Unmatched statement v=new Vector(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
5 | 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 |
6 | Type java.lang.String of variable dependentClass does not match with type java.io.File of variable parent |
7 | Type java.util.Hashtable of variable affectedClasses does not match with type java.util.Vector of variable v |