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: 13 | Number of AST nodes: 13 | |||
1 | synchronized (taskClassDefinitions) {↵ | 1 | synchronized (typeClassDefinitions) {↵ | |
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();↵ | 5 | for (Iterator i = antTypeTable.keySet().iterator();↵ | |
6 | i.hasNext();) {↵ | 6 | i.hasNext();) {↵ | |
7 | String name = (String) i.next();↵ | 7 | String name = (String) i.next();↵ | |
8 | Class clazz = antTypeTable.getExposedClass(name);↵ | 8 | Class clazz = antTypeTable.getExposedClass(name);↵ | |
9 | if (clazz == null) {↵ | 9 | if (clazz == null) {↵ | |
10 | continue;↵ | 10 | continue;↵ | |
11 | }↵ | 11 | }↵ | |
12 | if (Task.class.isAssignableFrom(clazz)) {↵ | 12 | if (!(Task.class.isAssignableFrom(clazz))) {↵ | |
13 | taskClassDefinitions.put(↵ | 13 | typeClassDefinitions.put(↵ | |
14 | name, antTypeTable.getTypeClass(name));↵ | 14 | name, antTypeTable.getTypeClass(name));↵ | |
15 | }↵ | 15 | }↵ | |
16 | }↵ | 16 | }↵ | |
17 | rebuildTaskClassDefinitions = false;↵ | 17 | rebuildTypeClassDefinitions = false;↵ | |
18 | }↵ | 18 | }↵ | |
19 | }↵ | 19 | }↵ | |
20 | }↵ | 20 | }↵ | |
21 | return taskClassDefinitions; | 21 | return typeClassDefinitions; | |
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.8 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 34 |
Number of mapped statements | 13 |
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) | 22.5 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | synchronized (taskClassDefinitions) |
| 1 | synchronized (typeClassDefinitions) | ||||||||||||
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; | ||||||||||||
13 | return taskClassDefinitions; |
| 13 | return typeClassDefinitions; |
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 |