try {
Source result = catalog.resolve(uri, null);
assertNotNull(result);
assertEquals(toURLString(xmlFile),
result.getSystemId());
} catch (Exception e) {
fail("resolve() failed!" + e.toString());
}
try {
Source result = catalog.resolve(uri, null);
assertNotNull(result);
assertEquals(toURLString(xmlFile),
result.getSystemId());
} catch (Exception e) {
fail("resolve() failed!" + e.toString());
}
Clone fragments detected by clone detection tool
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 testEntryReference()
|
|
Method name: void testNestedCatalog()
|
Number of AST nodes: 4
|
|
Number of AST nodes: 4
|
|
1 | try {↵ | | 1 | try {↵
|
2 | Source result = catalog.resolve(uri, null);↵ | | 2 | Source result = catalog.resolve(uri, null);↵
|
3 | assertNotNull(result);↵ | | 3 | assertNotNull(result);↵
|
4 | assertEquals(toURLString(xmlFile),↵ | | 4 | assertEquals(toURLString(xmlFile),↵
|
5 | result.getSystemId());↵ | | 5 | result.getSystemId());↵
|
6 | } catch (Exception e) {↵ | | 6 | } catch (Exception e) {↵
|
7 | fail("resolve() failed!" + e.toString());↵ | | 7 | fail("resolve() failed!" + e.toString());↵
|
8 | } | | 8 | }
|
See real code fragment |
|
See real code fragment |
Summary
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.2 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 16 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 4 |
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) | 0.7 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
26 | try | | 21 | try |
27 | Source result = catalog.resolve(uri, null); | | 22 | Source result = catalog.resolve(uri, null); |
28 | | | 23 | |
29 | assertEquals(toURLString(xmlFile), result.getSystemId()); | | 24 | assertEquals(toURLString(xmlFile), result.getSystemId()); |
Precondition Violations (0)
Row |
Violation |