executeTarget("testOrder2"); Manifest manifest = getManifest(EXPANDED_MANIFEST); Enumeration e = manifest.getSectionNames(); String section1 = (String)e.nextElement(); String section2 = (String)e.nextElement(); assertEquals("First section name unexpected", "Test2", section1); assertEquals("Second section name unexpected", "Test1", section2); Manifest.Section section = manifest.getSection("Test1"); e = section.getAttributeKeys(); String attr1Key = (String)e.nextElement(); String attr2Key = (String)e.nextElement(); String attr1 = section.getAttribute(attr1Key).getName(); String attr2 = section.getAttribute(attr2Key).getName(); assertEquals("First attribute name unexpected", "TestAttr2", attr1); assertEquals("Second attribute name unexpected", "TestAttr1", attr2);
executeTarget("testOrder1"); Manifest manifest = getManifest(EXPANDED_MANIFEST); Enumeration e = manifest.getSectionNames(); String section1 = (String)e.nextElement(); String section2 = (String)e.nextElement(); assertEquals("First section name unexpected", "Test1", section1); assertEquals("Second section name unexpected", "Test2", section2); Manifest.Section section = manifest.getSection("Test1"); e = section.getAttributeKeys(); String attr1Key = (String)e.nextElement(); String attr2Key = (String)e.nextElement(); String attr1 = section.getAttribute(attr1Key).getName(); String attr2 = section.getAttribute(attr2Key).getName(); assertEquals("First attribute name unexpected", "TestAttr1", attr1); assertEquals("Second attribute name unexpected", "TestAttr2", attr2);
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/ant/taskdefs/ManifestTest.java File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/ant/taskdefs/ManifestTest.java
Method name: void testOrder2() Method name: void testOrder1()
Number of AST nodes: 15 Number of AST nodes: 15
1
executeTarget("testOrder2");
1
executeTarget("testOrder1");
2
        Manifest manifest = getManifest(EXPANDED_MANIFEST);
2
        Manifest manifest = getManifest(EXPANDED_MANIFEST);
3
        Enumeration e = manifest.getSectionNames();
3
        Enumeration e = manifest.getSectionNames();
4
        String section1 = (String)e.nextElement();
4
        String section1 = (String)e.nextElement();
5
        String section2 = (String)e.nextElement();
5
        String section2 = (String)e.nextElement();
6
        assertEquals("First section name unexpected", "Test2", section1);
6
        assertEquals("First section name unexpected", "Test1", section1);
7
        assertEquals("Second section name unexpected", "Test1", section2);
7
        assertEquals("Second section name unexpected", "Test2", section2);
8
        Manifest.Section section = manifest.getSection("Test1");
8
        Manifest.Section section = manifest.getSection("Test1");
9
        e = section.getAttributeKeys();
9
        e = section.getAttributeKeys();
10
        String attr1Key = (String)e.nextElement();
10
        String attr1Key = (String)e.nextElement();
11
        String attr2Key = (String)e.nextElement();
11
        String attr2Key = (String)e.nextElement();
12
        String attr1 = section.getAttribute(attr1Key).getName();
12
        String attr1 = section.getAttribute(attr1Key).getName();
13
        String attr2 = section.getAttribute(attr2Key).getName();
13
        String attr2 = section.getAttribute(attr2Key).getName();
14
        assertEquals("First attribute name unexpected", "TestAttr2", attr1);
14
        assertEquals("First attribute name unexpected", "TestAttr1", attr1);
15
        assertEquals("Second attribute name unexpected", "TestAttr1", attr2);
15
        assertEquals("Second attribute name unexpected", "TestAttr2", attr2);
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 comparisons125
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements15
    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("testOrder2");
    1
    executeTarget("testOrder2");
    1
    executeTarget("testOrder1");
    Differences
    Expression1Expression2Difference
    "testOrder2""testOrder1"LITERAL_VALUE_MISMATCH
    1
    executeTarget("testOrder1");
    2
    Manifest manifest = getManifest(EXPANDED_MANIFEST);
    2
    Manifest manifest = getManifest(EXPANDED_MANIFEST);
    3
    Enumeration e = manifest.getSectionNames();
    3
    Enumeration e = manifest.getSectionNames();
    4
    String section1 = (String)e.nextElement();
    4
    String section1 = (String)e.nextElement();
    5
    String section2 = (String)e.nextElement();
    5
    String section2 = (String)e.nextElement();
    6
    assertEquals("First section name unexpected", "Test2", section1);
    6
    assertEquals("First section name unexpected", "Test2", section1);
    6
    assertEquals("First section name unexpected", "Test1", section1);
    Differences
    Expression1Expression2Difference
    "Test2""Test1"LITERAL_VALUE_MISMATCH
    6
    assertEquals("First section name unexpected", "Test1", section1);
    7
    assertEquals("Second section name unexpected", "Test1", section2);
    7
    assertEquals("Second section name unexpected", "Test1", section2);
    7
    assertEquals("Second section name unexpected", "Test2", section2);
    Differences
    Expression1Expression2Difference
    "Test1""Test2"LITERAL_VALUE_MISMATCH
    7
    assertEquals("Second section name unexpected", "Test2", section2);
    8
    Manifest.Section section = manifest.getSection("Test1");
    8
    Manifest.Section section = manifest.getSection("Test1");
    9
    e = section.getAttributeKeys();
    9
    e = section.getAttributeKeys();
    10
    String attr1Key = (String)e.nextElement();
    10
    String attr1Key = (String)e.nextElement();
    11
    String attr2Key = (String)e.nextElement();
    11
    String attr2Key = (String)e.nextElement();
    12
    String attr1 = section.getAttribute(attr1Key).getName();
    12
    String attr1 = section.getAttribute(attr1Key).getName();
    13
    String attr2 = section.getAttribute(attr2Key).getName();
    13
    String attr2 = section.getAttribute(attr2Key).getName();
    14
    assertEquals("First attribute name unexpected", "TestAttr2", attr1);
    14
    assertEquals("First attribute name unexpected", "TestAttr2", attr1);
    14
    assertEquals("First attribute name unexpected", "TestAttr1", attr1);
    Differences
    Expression1Expression2Difference
    "TestAttr2""TestAttr1"LITERAL_VALUE_MISMATCH
    14
    assertEquals("First attribute name unexpected", "TestAttr1", attr1);
    15
    assertEquals("Second attribute name unexpected", "TestAttr1", attr2);
    15
    assertEquals("Second attribute name unexpected", "TestAttr1", attr2);
    15
    assertEquals("Second attribute name unexpected", "TestAttr2", attr2);
    Differences
    Expression1Expression2Difference
    "TestAttr1""TestAttr2"LITERAL_VALUE_MISMATCH
    15
    assertEquals("Second attribute name unexpected", "TestAttr2", attr2);
    Precondition Violations (0)
    Row Violation