try { configureProject("src/etc/testcases/core/include/including_file_parse_error/build.xml"); fail("should have caused a parser exception"); } catch (BuildException e) { assertTrue(e.getLocation().toString() + " should refer to build.xml", e.getLocation().toString().indexOf("build.xml:") > -1); }
try { configureProject("src/etc/testcases/core/include/included_file_parse_error/build.xml"); fail("should have caused a parser exception"); } catch (BuildException e) { assertTrue(e.getLocation().toString() + " should refer to included_file.xml", e.getLocation().toString() .indexOf("included_file.xml:") > -1); }
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 testParseErrorInIncluding() Method name: void testParseErrorInIncluded()
Number of AST nodes: 3 Number of AST nodes: 3
1
try {
1
try {
2
            configureProject("src/etc/testcases/core/include/including_file_parse_error/build.xml");
2
            configureProject("src/etc/testcases/core/include/included_file_parse_error/build.xml");
3
            fail("should have caused a parser exception");
3
            fail("should have caused a parser exception");
4
        } catch (BuildException e) {
4
        } catch (BuildException e) {
5
            assertTrue(e.getLocation().toString()
5
            assertTrue(e.getLocation().toString()
6
                       + " should refer to build.xml",
6
                       + " should refer to included_file.xml",
7
                       e.getLocation().toString().indexOf("build
7
                       e.getLocation().toString()
8
.xml:") > -1);
8
                       .indexOf("included_file.xml:") > -1);
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.5
Clones locationClones are declared in the same class
Number of node comparisons9
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements3
    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
    try
    1
    try
    1
    try
    Differences
    Expression1Expression2Difference
    " should refer to build.xml"" should refer to included_file.xml"LITERAL_VALUE_MISMATCH
    "build.xml:""included_file.xml:"LITERAL_VALUE_MISMATCH
    1
    try
    2
    configureProject("src/etc/testcases/core/include/including_file_parse_error/build.xml");
    2
    configureProject("src/etc/testcases/core/include/including_file_parse_error/build.xml");
    2
    configureProject("src/etc/testcases/core/include/included_file_parse_error/build.xml");
    Differences
    Expression1Expression2Difference
    "src/etc/testcases/core/include/including_file_parse_error/build.xml""src/etc/testcases/core/include/included_file_parse_error/build.xml"LITERAL_VALUE_MISMATCH
    2
    configureProject("src/etc/testcases/core/include/included_file_parse_error/build.xml");
    3
    fail("should have caused a parser exception");
    3
    fail("should have caused a parser exception");
    Precondition Violations (0)
    Row Violation