executeTarget("simple"); // get the fileset and its basedir Project p = getProject(); FileSet fileset = (FileSet) p.getReference("testfileset"); File baseDir = fileset.getDir(p); String log = getLog(); assertTrue("Expecting attribute value printed", log.indexOf("Attribute attr1 = test") != -1); assertTrue("Expecting nested element value printed", log.indexOf("Fileset basedir = " + baseDir.getAbsolutePath()) != -1);
executeTarget("nestedbyclassname"); // get the fileset and its basedir Project p = getProject(); FileSet fileset = (FileSet) p.getReference("testfileset"); File baseDir = fileset.getDir(p); String log = getLog(); assertTrue("Expecting attribute value to be printed", log.indexOf("Attribute attr1 = test") != -1); assertTrue("Expecting nested element value to be printed", log.indexOf("Fileset basedir = " + baseDir.getAbsolutePath()) != -1);
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/ant/taskdefs/optional/script/ScriptDefTest.java File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/ant/taskdefs/optional/script/ScriptDefTest.java
Method name: void testSimple() Method name: void testNestedByClassName()
Number of AST nodes: 7 Number of AST nodes: 7
1
executeTarget("simple");
1
executeTarget("nestedbyclassname");
2
        // get the fileset and its basedir
2
        // get the fileset and its basedir
3
        Project p = getProject();
3
        Project p = getProject();
4
        FileSet fileset = (FileSet) p.getReference("testfileset");
4
        FileSet fileset = (FileSet) p.getReference("testfileset");
5
        File baseDir = fileset.getDir(p);
5
        File baseDir = fileset.getDir(p);
6
        String log = getLog();
6
        String log = getLog();
7
        assertTrue("Expecting attribute value printed",
7
        assertTrue("Expecting attribute value to be printed",
8
            log.indexOf("Attribute attr1 = test") != -1);
8
            log.indexOf("Attribute attr1 = test") != -1);
9
        assertTrue("Expecting nested element value printed",
9
        assertTrue("Expecting nested element value to be printed",
10
            log.indexOf("Fileset basedir = " + baseDir.getAbsolutePath()) != -1);
10
            log.indexOf("Fileset basedir = " + baseDir.getAbsolutePath()) != -1);
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.0
Clones locationClones are declared in the same class
Number of node comparisons25
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements7
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    executeTarget("simple");
    1
    executeTarget("simple");
    1
    executeTarget("nestedbyclassname");
    Differences
    Expression1Expression2Difference
    "simple""nestedbyclassname"LITERAL_VALUE_MISMATCH
    1
    executeTarget("nestedbyclassname");
    2
    Project p = getProject();
    2
    Project p = getProject();
    3
    FileSet fileset = (FileSet)p.getReference("testfileset");
    3
    FileSet fileset = (FileSet)p.getReference("testfileset");
    4
    File baseDir = fileset.getDir(p);
    4
    File baseDir = fileset.getDir(p);
    5
    String log = getLog();
    5
    String log = getLog();
    6
    assertTrue("Expecting attribute value printed", log.indexOf("Attribute attr1 = test") != -1);
    6
    assertTrue("Expecting attribute value printed", log.indexOf("Attribute attr1 = test") != -1);
    6
    assertTrue("Expecting attribute value to be printed", log.indexOf("Attribute attr1 = test") != -1);
    Differences
    Expression1Expression2Difference
    "Expecting attribute value printed""Expecting attribute value to be printed"LITERAL_VALUE_MISMATCH
    6
    assertTrue("Expecting attribute value to be printed", log.indexOf("Attribute attr1 = test") != -1);
    7
    assertTrue("Expecting nested element value printed", log.indexOf("Fileset basedir = " + baseDir.getAbsolutePath()) != -1);
    7
    assertTrue("Expecting nested element value printed", log.indexOf("Fileset basedir = " + baseDir.getAbsolutePath()) != -1);
    7
    assertTrue("Expecting nested element value to be printed", log.indexOf("Fileset basedir = " + baseDir.getAbsolutePath()) != -1);
    Differences
    Expression1Expression2Difference
    "Expecting nested element value printed""Expecting nested element value to be printed"LITERAL_VALUE_MISMATCH
    7
    assertTrue("Expecting nested element value to be printed", log.indexOf("Fileset basedir = " + baseDir.getAbsolutePath()) != -1);
    Precondition Violations (0)
    Row Violation