File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/ant/IntrospectionHelperTest.java | File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/ant/IntrospectionHelperTest.java | |||
Method name: void testGetNestedElements()
|
Method name: void testGetAttributes()
|
|||
Number of AST nodes: 8 | Number of AST nodes: 8 | |||
1 | Map elemMap = getExpectedNestedElements();↵ | 1 | Map attrMap = getExpectedAttributes();↵ | |
2 | Enumeration e = ih.getNestedElements();↵ | 2 | Enumeration e = ih.getAttributes();↵ | |
3 | while (e.hasMoreElements()) {↵ | 3 | while (e.hasMoreElements()) {↵ | |
4 | String name = (String) e.nextElement();↵ | 4 | String name = (String) e.nextElement();↵ | |
5 | Class expect = (Class) elemMap.get(name);↵ | 5 | Class expect = (Class) attrMap.get(name);↵ | |
6 | assertNotNull("Support for "+name+" in IntrospectioNHelperTest?",↵ | 6 | assertNotNull("Support for "+name+" in IntrospectionHelperTest?",↵ | |
7 | expect);↵ | 7 | expect);↵ | |
8 | assertEquals("Return type of "+name, expect, ih.getElementType(name));↵ | 8 | assertEquals("Type of "+name, expect, ih.getAttributeType(name));↵ | |
9 | elemMap.remove(name);↵ | 9 | attrMap.remove(name);↵ | |
10 | } | 10 |
| |
See real code fragment | See real code fragment |
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 1 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.1 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 40 |
Number of mapped statements | 8 |
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) | 38.4 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | Map elemMap = getExpectedNestedElements(); |
| 1 | Map attrMap = getExpectedAttributes(); | |||||||||||||||
2 | Enumeration e = ih.getNestedElements(); |
| 2 | Enumeration e = ih.getAttributes(); | |||||||||||||||
3 | while (e.hasMoreElements()) | 3 | while (e.hasMoreElements()) | ||||||||||||||||
4 | String name = (String)e.nextElement(); | 4 | String name = (String)e.nextElement(); | ||||||||||||||||
5 | Class expect = (Class)elemMap.get(name); |
| 5 | Class expect = (Class)attrMap.get(name); | |||||||||||||||
6 | assertNotNull("Support for " + name + " in IntrospectioNHelperTest?", expect); |
| 6 | assertNotNull("Support for " + name + " in IntrospectionHelperTest?", expect); | |||||||||||||||
7 | assertEquals("Return type of " + name, expect, ih.getElementType(name)); |
| 7 | assertEquals("Type of " + name, expect, ih.getAttributeType(name)); | |||||||||||||||
8 | elemMap.remove(name); |
| 8 | attrMap.remove(name); |
Row | Violation |
---|---|
1 | Expression ih.getElementType(name) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression ih.getAttributeType(name) cannot be parameterized, because it has dependencies to/from statements that will be extracted |