configureProject("src/etc/testcases/core/include/included_file_task_error/build.xml"); try { executeTarget("test"); fail("should have cause a build failure"); } catch (BuildException e) { assertTrue(e.getMessage() + " should start with \'Warning: Could not find", e.getMessage().startsWith("Warning: Could not find file ")); assertTrue(e.getLocation().toString() + " should end with included_file.xml:2: ", e.getLocation().toString().endsWith("included_file.xml:2: ")); }
configureProject("src/etc/testcases/core/include/including_file_task_error/build.xml"); try { executeTarget("test"); fail("should have cause a build failure"); } catch (BuildException e) { assertTrue(e.getMessage() + " should start with \'Warning: Could not find", e.getMessage().startsWith("Warning: Could not find file ")); assertTrue(e.getLocation().toString() + " should end with build.xml:14: ", e.getLocation().toString().endsWith("build.xml:14: ")); }
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/ant/IncludeTest.java File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/ant/IncludeTest.java
Method name: void testTaskErrorInIncluded() Method name: void testTaskErrorInIncluding()
Number of AST nodes: 4 Number of AST nodes: 4
1
configureProject("src/etc/testcases/core/include/included_file_task_error/build.xml");
1
configureProject("src/etc/testcases/core/include/including_file_task_error/build.xml");
2
        try {
2
        try {
3
            executeTarget("test");
3
            executeTarget("test");
4
            fail("should have cause a build failure");
4
            fail("should have cause a build failure");
5
        } catch (BuildException e) {
5
        } catch (BuildException e) {
6
            assertTrue(e.getMessage()
6
            assertTrue(e.getMessage()
7
                       + " should start with \'Warning: Could not find",
7
                       + " should start with \'Warning: Could not find",
8
                         e.getMessage().startsWith("Warning: Could not find file "));
8
                         e.getMessage().startsWith("Warning: Could not find file "));
9
            assertTrue(e.getLocation().toString()
9
            assertTrue(e.getLocation().toString()
10
                       + " should end with included_file.xml:2: ",
10
                       + " should end with build.xml:14: ",
11
                       e.getLocation().toString().endsWith("included_file.xml:2: "));
11
                       e.getLocation().toString().endsWith("build.xml:14: "));
12
        }
12
        }
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.6
Clones locationClones are declared in the same class
Number of node comparisons10
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements4
    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.6
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    configureProject("src/etc/testcases/core/include/included_file_task_error/build.xml");
    1
    configureProject("src/etc/testcases/core/include/included_file_task_error/build.xml");
    1
    configureProject("src/etc/testcases/core/include/including_file_task_error/build.xml");
    Differences
    Expression1Expression2Difference
    "src/etc/testcases/core/include/included_file_task_error/build.xml""src/etc/testcases/core/include/including_file_task_error/build.xml"LITERAL_VALUE_MISMATCH
    1
    configureProject("src/etc/testcases/core/include/including_file_task_error/build.xml");
    2
    try
    2
    try
    2
    try
    Differences
    Expression1Expression2Difference
    " should end with included_file.xml:2: "" should end with build.xml:14: "LITERAL_VALUE_MISMATCH
    "included_file.xml:2: ""build.xml:14: "LITERAL_VALUE_MISMATCH
    2
    try
    3
    executeTarget("test");
    3
    executeTarget("test");
    4
    fail("should have cause a build failure");
    4
    fail("should have cause a build failure");
    Precondition Violations (0)
    Row Violation