File path: /apache-ant-1.7.0/src/org/apache/tools/ant/ComponentHelper.java | File path: /apache-ant-1.7.0/src/org/apache/tools/ant/ComponentHelper.java | |||
Method name: Hashtable getTaskDefinitions()
|
Method name: Hashtable getDataTypeDefinitions()
|
|||
Number of AST nodes: 7 | Number of AST nodes: 7 | |||
1 | for (Iterator i = antTypeTable.keySet().iterator();↵ | 1 | for (Iterator i = antTypeTable.keySet().iterator();↵ | |
2 | i.hasNext();) {↵ | 2 | i.hasNext();) {↵ | |
3 | String name = (String) i.next();↵ | 3 | String name = (String) i.next();↵ | |
4 | Class clazz = antTypeTable.getExposedClass(name);↵ | 4 | Class clazz = antTypeTable.getExposedClass(name);↵ | |
5 | if (clazz == null) {↵ | 5 | if (clazz == null) {↵ | |
6 | continue;↵ | 6 | continue;↵ | |
7 | }↵ | 7 | }↵ | |
8 | if (Task.class.isAssignableFrom(clazz)) {↵ | 8 | if (!(Task.class.isAssignableFrom(clazz))) {↵ | |
9 | taskClassDefinitions.put(↵ | 9 | typeClassDefinitions.put(↵ | |
10 | name, antTypeTable.getTypeClass(name));↵ | 10 | name, antTypeTable.getTypeClass(name));↵ | |
11 | }↵ | 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.4 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 23 |
Number of mapped statements | 7 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 7.5 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
5 | for (Iterator i = antTypeTable.keySet().iterator(); i.hasNext(); ) | 5 | for (Iterator i = antTypeTable.keySet().iterator(); i.hasNext(); ) | |||||||||||||
6 | String name = (String)i.next(); | 6 | String name = (String)i.next(); | |||||||||||||
7 | Class clazz = antTypeTable.getExposedClass(name); | 7 | Class clazz = antTypeTable.getExposedClass(name); | |||||||||||||
8 | if (clazz == null) | 8 | if (clazz == null) | |||||||||||||
9 | continue; | 9 | continue; | |||||||||||||
10 | if (Task.class.isAssignableFrom(clazz)) |
| 10 | if (!(Task.class.isAssignableFrom(clazz))) | ||||||||||||
11 | taskClassDefinitions.put(name, antTypeTable.getTypeClass(name)); |
| 11 | typeClassDefinitions.put(name, antTypeTable.getTypeClass(name)); |
Row | Violation |
---|---|
1 | Expression Task.class.isAssignableFrom(clazz) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression !(Task.class.isAssignableFrom(clazz)) cannot be parameterized, because it has dependencies to/from statements that will be extracted |