catalog2.setRefid(new Reference("catalog")); try { catalog2.addConfiguredXMLCatalog(catalog); fail("Can add nested XMLCatalog to XMLCatalog that is a reference"); } catch (BuildException be) { assertEquals("You must not specify nested elements when using refid", be.getMessage()); }
f.setRefid(new Reference("dummy")); try { f.getDir(project); fail("Can make FileList a Reference to itself."); } catch (BuildException be) { assertEquals("This data type contains a circular reference.", be.getMessage()); }
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/FileListTest.java
Method name: void testEmptyElementIfIsReference() Method name: void testCircularReferenceCheck()
Number of AST nodes: 4 Number of AST nodes: 4
1
catalog2.setRefid(new Reference("catalog"));
1
f.setRefid(new Reference("dummy"));
2
        try {
2
        try {
3
            catalog2.addConfiguredXMLCatalog(catalog);
3
            
4
            fail("Can add nested XMLCatalog to XMLCatalog that 
4
f.getDir(project);
5
is a reference");
5
            fail("Can make FileList a Reference to itself.");
6
        } catch (BuildException be) {
6
        } catch (BuildException be) {
7
            assertEquals("You must not specify nested elements when using refid",
7
            assertEquals("This data type contains a circular reference.",
8
                         be.getMessage());
8
                         be.getMessage());
9
        }
9
        }
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.2
Clones locationClones are in different classes having the same super class
Number of node comparisons10
  1. {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)1.9
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    10
    catalog2.setRefid(new Reference("catalog"));
    10
    catalog2.setRefid(new Reference("catalog"));
    3
    f.setRefid(new Reference("dummy"));
    Differences
    Expression1Expression2Difference
    "catalog""dummy"LITERAL_VALUE_MISMATCH
    catalog2fVARIABLE_NAME_MISMATCH
    org.apache.tools.ant.types.XMLCatalogorg.apache.tools.ant.types.FileListSUBCLASS_TYPE_MISMATCH
    3
    f.setRefid(new Reference("dummy"));
    11
    try
    11
    try
    4
    try
    Differences
    Expression1Expression2Difference
    "You must not specify nested elements when using refid""This data type contains a circular reference."LITERAL_VALUE_MISMATCH
    4
    try
                                              
    5
    f.getDir(project);
    12
    catalog2.addConfiguredXMLCatalog(catalog);
                                                                                                
    13
    fail("Can add nested XMLCatalog to XMLCatalog that is a reference");
    13
    fail("Can add nested XMLCatalog to XMLCatalog that is a reference");
    6
    fail("Can make FileList a Reference to itself.");
    Differences
    Expression1Expression2Difference
    "Can add nested XMLCatalog to XMLCatalog that is a reference""Can make FileList a Reference to itself."LITERAL_VALUE_MISMATCH
    6
    fail("Can make FileList a Reference to itself.");
    Precondition Violations (0)
    Row Violation