Source result = catalog.resolve(uri, null); assertNotNull(result); String resultStr = new URL(result.getSystemId()).getFile(); assertTrue(toURLString(xmlFile).endsWith(resultStr));
InputSource result = catalog.resolveEntity(publicId, "nap:chemical+brothers"); assertNotNull(result); String resultStr = new URL(result.getSystemId()).getFile(); assertTrue(toURLString(dtdFile).endsWith(resultStr));
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 testClasspath() Method name: void testClasspath()
Number of AST nodes: 4 Number of AST nodes: 4
1
Source result = catalog.resolve(uri, null
1
InputSource result = catalog.resolveEntity(publicId,
2
);
2
                                                       "nap:chemical+brothers");
3
            assertNotNull(result);
3
            assertNotNull(result);
4
            String resultStr = new URL(result.getSystemId()).getFile();
4
            String resultStr = new URL(result.getSystemId()).getFile();
5
            assertTrue(toURLString(xmlFile).endsWith(resultStr));
5
            assertTrue(toURLString(dtdFile).endsWith(resultStr));
Summary
Number of common nesting structure subtrees1
Number of refactorable cases0
Number of non-refactorable cases1
Time elapsed for finding largest common nesting structure subtrees (ms)0.0
Clones locationClones are in the same method
Number of node comparisons16
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements3
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    27
    assertNotNull(result);
    27
    assertNotNull(result);
    22
    assertNotNull(result);
    Differences
    Expression1Expression2Difference
    javax.xml.transform.Sourceorg.xml.sax.InputSourceVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type javax.xml.transform.Source of variable result does not match with type org.xml.sax.InputSource of variable result
    • Make classes javax.xml.transform.Source and org.xml.sax.InputSource extend a common superclass
    22
    assertNotNull(result);
    28
    String resultStr = new URL(result.getSystemId()).getFile();
    28
    String resultStr = new URL(result.getSystemId()).getFile();
    23
    String resultStr = new URL(result.getSystemId()).getFile();
    Differences
    Expression1Expression2Difference
    javax.xml.transform.Sourceorg.xml.sax.InputSourceVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type javax.xml.transform.Source of variable result does not match with type org.xml.sax.InputSource of variable result
    • Make classes javax.xml.transform.Source and org.xml.sax.InputSource extend a common superclass
    23
    String resultStr = new URL(result.getSystemId()).getFile();
    29
    assertTrue(toURLString(xmlFile).endsWith(resultStr));
    29
    assertTrue(toURLString(xmlFile).endsWith(resultStr));
    24
    assertTrue(toURLString(dtdFile).endsWith(resultStr));
    Differences
    Expression1Expression2Difference
    xmlFiledtdFileVARIABLE_NAME_MISMATCH
    24
    assertTrue(toURLString(dtdFile).endsWith(resultStr));
    Precondition Violations (2)
    Row Violation
    1Type javax.xml.transform.Source of variable result does not match with type org.xml.sax.InputSource of variable result
    2Type javax.xml.transform.Source of variable result does not match with type org.xml.sax.InputSource of variable result