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: 11 | Number of AST nodes: 11 | |||
1 | synchronized (antTypeTable) {↵ | 1 | synchronized (antTypeTable) {↵ | |
2 | if (rebuildTaskClassDefinitions) {↵ | 2 | if (rebuildTypeClassDefinitions) {↵ | |
3 | taskClassDefinitions.clear();↵ | 3 | typeClassDefinitions.clear();↵ | |
4 | for (Iterator i = antTypeTable.keySet().iterator();↵ | 4 | for (Iterator i = antTypeTable.keySet().iterator();↵ | |
5 | i.hasNext();) {↵ | 5 | 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 | }↵ | 10 | }↵ | |
11 | if (Task.class.isAssignableFrom(clazz)) {↵ | 11 | if (!(Task.class.isAssignableFrom(clazz))) {↵ | |
12 | taskClassDefinitions.put(↵ | 12 | typeClassDefinitions.put(↵ | |
13 | name, antTypeTable.getTypeClass(name));↵ | 13 | name, antTypeTable.getTypeClass(name));↵ | |
14 | }↵ | 14 | }↵ | |
15 | }↵ | 15 | }↵ | |
16 | rebuildTaskClassDefinitions = false;↵ | 16 | rebuildTypeClassDefinitions = false;↵ | |
17 | }↵ | 17 | }↵ | |
18 | } | 18 |
| |
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.5 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 33 |
Number of mapped statements | 11 |
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) | 6.9 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2 | synchronized (antTypeTable) | 2 | synchronized (antTypeTable) | |||||||||||||
3 | if (rebuildTaskClassDefinitions) |
| 3 | if (rebuildTypeClassDefinitions) | ||||||||||||
4 | taskClassDefinitions.clear(); |
| 4 | typeClassDefinitions.clear(); | ||||||||||||
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)); | ||||||||||||
12 | rebuildTaskClassDefinitions = false; |
| 12 | rebuildTypeClassDefinitions = false; |
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 |
3 | Expression rebuildTaskClassDefinitions is a field being modified, and thus it cannot be parameterized |
4 | Expression rebuildTypeClassDefinitions is a field being modified, and thus it cannot be parameterized |