File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/ant/types/XMLCatalogTest.java | File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/ant/types/XMLCatalogTest.java | |||
Method name: void testSimpleEntry()
|
Method name: void testNestedCatalog()
|
|||
Number of AST nodes: 4 | Number of AST nodes: 4 | |||
1 | try {↵ | 1 | try {↵ | |
2 | InputSource result = catalog.resolveEntity("-//stevo//DTD doc 1.0//EN",↵ | 2 | Source result = catalog.resolve↵ | |
3 | "nap:chemical+brothers");↵ | 3 | (uri, null);↵ | |
4 | assertNotNull(result);↵ | 4 | assertNotNull(result);↵ | |
5 | assertEquals(toURLString(dtdFile),↵ | 5 | assertEquals(toURLString(xmlFile),↵ | |
6 | result.getSystemId());↵ | 6 | result.getSystemId());↵ | |
7 | } catch (Exception e) {↵ | 7 | } catch (Exception e) {↵ | |
8 | fail("resolveEntity() failed!" + e.toString());↵ | 8 | fail("resolve() failed!" + e.toString());↵ | |
9 | } | 9 |
| |
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.2 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 16 |
Number of mapped statements | 3 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 0.7 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
7 | try |
| 21 | try | ||||||||||||||
8 | InputSource result = catalog.resolveEntity("-//stevo//DTD doc 1.0//EN", "nap:chemical+brothers"); |
| | |||||||||||||||
|
| 22 | Source result = catalog.resolve(uri, null); | |||||||||||||||
9 | assertNotNull(result); |
| 23 | assertNotNull(result); | ||||||||||||||
10 | assertEquals(toURLString(dtdFile), result.getSystemId()); |
| 24 | assertEquals(toURLString(xmlFile), result.getSystemId()); |
Row | Violation |
---|---|
1 | Unmatched statement InputSource result=catalog.resolveEntity("-//stevo//DTD doc 1.0//EN","nap:chemical+brothers"); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted |
2 | Unmatched statement Source result=catalog.resolve(uri,null); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted |
3 | Type org.xml.sax.InputSource of variable result does not match with type javax.xml.transform.Source of variable result |
4 | Type org.xml.sax.InputSource of variable result does not match with type javax.xml.transform.Source of variable result |