l = p.list(); assertEquals("1 after setLocation", 1, l.length); p.setPath("\\a;/a"); l = p.list(); assertEquals("1 after setPath", 1, l.length); p.append(new Path(project, "/a;\\a:\\a")); l = p.list(); assertEquals("1 after append", 1, l.length);
l = p.list(); assertEquals("3 after setLocation", 3, l.length); p.setPath("\\d;\\e"); l = p.list(); assertEquals("5 after setPath", 5, l.length); p.append(new Path(project, "\\f")); l = p.list(); assertEquals("6 after append", 6, l.length);
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/ant/types/PathTest.java File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/ant/types/PathTest.java
Method name: void testUnique() Method name: void testAppending()
Number of AST nodes: 8 Number of AST nodes: 8
1
l = p.list();
1
l = p.list();
2
        assertEquals("1 after setLocation", 1, l.length);
2
        assertEquals("3 after setLocation", 3, l.length);
3
        p.setPath("\\a;/a");
3
        p.setPath("\\d;\\e");
4
        l = p.list();
4
        l = p.list();
5
        assertEquals("1 after setPath", 1, l.length);
5
        assertEquals("5 after setPath", 5, l.length);
6
        p.append(new Path(project, "/a;\\a:\\a"));
6
        p.append(new Path(project, "\\f"));
7
        l = p.list();
7
        l = p.list();
8
        assertEquals("1 after append", 1, l.length);
8
        assertEquals("6 after append", 6, l.length);
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 comparisons34
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements8
    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
    6
    l = p.list();
    5
    l = p.list();
    7
    assertEquals("1 after setLocation", 1, l.length);
    7
    assertEquals("1 after setLocation", 1, l.length);
    6
    assertEquals("3 after setLocation", 3, l.length);
    Differences
    Expression1Expression2Difference
    "1 after setLocation""3 after setLocation"LITERAL_VALUE_MISMATCH
    13LITERAL_VALUE_MISMATCH
    6
    assertEquals("3 after setLocation", 3, l.length);
    8
    p.setPath("\\a;/a");
    8
    p.setPath("\\a;/a");
    7
    p.setPath("\\d;\\e");
    Differences
    Expression1Expression2Difference
    "\\a;/a""\\d;\\e"LITERAL_VALUE_MISMATCH
    7
    p.setPath("\\d;\\e");
    9
    l = p.list();
    8
    l = p.list();
    10
    assertEquals("1 after setPath", 1, l.length);
    10
    assertEquals("1 after setPath", 1, l.length);
    9
    assertEquals("5 after setPath", 5, l.length);
    Differences
    Expression1Expression2Difference
    "1 after setPath""5 after setPath"LITERAL_VALUE_MISMATCH
    15LITERAL_VALUE_MISMATCH
    9
    assertEquals("5 after setPath", 5, l.length);
    11
    p.append(new Path(project, "/a;\\a:\\a"));
    11
    p.append(new Path(project, "/a;\\a:\\a"));
    10
    p.append(new Path(project, "\\f"));
    Differences
    Expression1Expression2Difference
    "/a;\\a:\\a""\\f"LITERAL_VALUE_MISMATCH
    10
    p.append(new Path(project, "\\f"));
    12
    l = p.list();
    11
    l = p.list();
    13
    assertEquals("1 after append", 1, l.length);
    13
    assertEquals("1 after append", 1, l.length);
    12
    assertEquals("6 after append", 6, l.length);
    Differences
    Expression1Expression2Difference
    "1 after append""6 after append"LITERAL_VALUE_MISMATCH
    16LITERAL_VALUE_MISMATCH
    12
    assertEquals("6 after append", 6, l.length);
    Precondition Violations (0)
    Row Violation