File dtdFile = project.resolveFile(sysid);
try {
InputSource result = catalog.resolveEntity("-//stevo//DTD doc 1.0//EN",
"nap:chemical+brothers");
assertNotNull(result);
assertEquals(toURLString(dtdFile),
result.getSystemId());
} catch (Exception e) {
fail("resolveEntity() failed!" + e.toString());
}
File dtdFile = project.resolveFile(sysid);
try {
InputSource result = catalog.resolveEntity("-//stevo//DTD doc 1.0//EN",
"nap:chemical+brothers");
assertNotNull(result);
assertEquals(toURLString(dtdFile),
result.getSystemId());
} catch (Exception e) {
fail("resolveEntity() 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 testAbsolutePath()
|
|
Method name: void testSimpleEntry()
|
Number of AST nodes: 5
|
|
Number of AST nodes: 5
|
|
1 | File dtdFile = project.resolveFile(sysid);↵ | | 1 | File dtdFile = project.resolveFile(sysid);↵
|
|
2 | try {↵ | | 2 | try {↵
|
3 | InputSource result = catalog.resolveEntity("-//stevo//DTD doc 1.0//EN",↵ | | 3 | InputSource result = catalog.resolveEntity("-//stevo//DTD doc 1.0//EN",↵
|
4 | "nap:chemical+brothers");↵ | | 4 | "nap:chemical+brothers");↵
|
5 | assertNotNull(result);↵ | | 5 | assertNotNull(result);↵
|
6 | assertEquals(toURLString(dtdFile),↵ | | 6 | assertEquals(toURLString(dtdFile),↵
|
7 | result.getSystemId());↵ | | 7 | result.getSystemId());↵
|
8 | } catch (Exception e) {↵ | | 8 | } catch (Exception e) {↵
|
9 | fail("resolveEntity() failed!" + e.toString());↵ | | 9 | fail("resolveEntity() failed!" + e.toString());↵
|
10 | } | | 10 | }
|
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.3 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 17 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 5 |
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) | 2.2 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
6 | File dtdFile = project.resolveFile(sysid); | | 6 | File dtdFile = project.resolveFile(sysid); |
7 | try | | 7 | try |
8 | InputSource result = catalog.resolveEntity("-//stevo//DTD doc 1.0//EN", "nap:chemical+brothers"); | | 8 | InputSource result = catalog.resolveEntity("-//stevo//DTD doc 1.0//EN", "nap:chemical+brothers"); |
9 | | | 9 | |
10 | assertEquals(toURLString(dtdFile), result.getSystemId()); | | 10 | assertEquals(toURLString(dtdFile), result.getSystemId()); |
Precondition Violations (0)
Row |
Violation |