try { testoutput(r); fail("should have caught ImmutableResourceException"); } catch (ImmutableResourceException e) { } catch (IOException e) { fail("caught some other IOException: " + e); } assertEquals("bar", r.getValue());
try { testoutput(r); fail("should have caught ImmutableResourceException"); } catch (ImmutableResourceException e) { } catch (IOException e) { fail("caught some other IOException: " + e); } assertPropertyEquals("bar", "bar");
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/ant/types/ResourceOutputTest.java File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/ant/types/ResourceOutputTest.java
Method name: void teststringoutput2() Method name: void testpropertyoutput2()
Number of AST nodes: 4 Number of AST nodes: 4
1
try {
1
try {
2
            testoutput(r);
2
            testoutput(r);
3
            fail("should have caught ImmutableResourceException");
3
            fail("should have caught ImmutableResourceException");
4
        } catch (ImmutableResourceException e) {
4
        } catch (ImmutableResourceException e) {
5
        } catch (IOException e) {
5
        } catch (IOException e) {
6
            fail("caught some other IOException: " + e);
6
            fail("caught some other IOException: " + e);
7
        }
7
        }
8
        assertEquals("bar", r.getValue());
8
        assertPropertyEquals("bar", "bar");
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.2
Clones locationClones are declared in the same class
Number of node comparisons10
  1. {Non-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)18.6
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    2
    try
    3
    try
    3
    testoutput(r);
    3
    testoutput(r);
    4
    testoutput(r);
    Differences
    Expression1Expression2Difference
    org.apache.tools.ant.types.resources.StringResourceorg.apache.tools.ant.types.resources.PropertyResourceSUBCLASS_TYPE_MISMATCH
    4
    testoutput(r);
    4
    fail("should have caught ImmutableResourceException");
    5
    fail("should have caught ImmutableResourceException");
    5
    assertEquals("bar", r.getValue());
    5
    assertEquals("bar", r.getValue());
    6
    assertPropertyEquals("bar", "bar");
    Differences
    Expression1Expression2Difference
    r.getValue()"bar"TYPE_COMPATIBLE_REPLACEMENT
    assertEqualsassertPropertyEqualsMETHOD_INVOCATION_NAME_MISMATCH
    assertEquals("bar",r.getValue())assertPropertyEquals("bar","bar")TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression assertEquals("bar",r.getValue()) is a void method call, and thus it cannot be parameterized
    Expression assertPropertyEquals("bar","bar") is a void method call, and thus it cannot be parameterized
    Expression assertEquals("bar",r.getValue()) is a void method call, and thus it cannot be parameterized
    Expression assertPropertyEquals("bar","bar") is a void method call, and thus it cannot be parameterized
    6
    assertPropertyEquals("bar", "bar");
    Precondition Violations (4)
    Row Violation
    1Expression assertEquals("bar",r.getValue()) is a void method call, and thus it cannot be parameterized
    2Expression assertPropertyEquals("bar","bar") is a void method call, and thus it cannot be parameterized
    3Expression assertEquals("bar",r.getValue()) is a void method call, and thus it cannot be parameterized
    4Expression assertPropertyEquals("bar","bar") is a void method call, and thus it cannot be parameterized