assertNotNull("Should match foo*bar", result); assertEquals("only one result for foo.bar", 1, result.length); assertEquals("plonk.pling", result[0]); // and a little longer result = m.mapFileName("foo.baz.bar"); assertNotNull("Should match foo*bar", result); assertEquals("only one result for foo.baz.bar", 1, result.length); assertEquals("plonk.baz.pling", result[0]);
result = m.mapFileName("foo.baz.bar"); assertNotNull("Should match foo*bar", result); assertEquals("only one result for foo.baz.bar", 1, result.length); assertEquals("plonk.baz.pling", result[0]); // and a little shorter result = m.mapFileName("foobar"); assertNotNull("Should match foo*bar", result); assertEquals("only one result for foobar", 1, result.length); assertEquals("plonkpling", result[0]);
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/ant/util/GlobPatternMapperTest.java File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/ant/util/GlobPatternMapperTest.java
Method name: void testPreAndPostfix() Method name: void testPreAndPostfix()
Number of AST nodes: 7 Number of AST nodes: 8
1
result = m.mapFileName("foo.baz.bar");
1
assertNotNull("Should match foo*bar", result);
2
        assertNotNull("Should match foo*bar", result);
2
        assertEquals("only one result for foo.bar", 1, result.length);
3
        assertEquals("only one result for foo.baz.bar", 1, result.length);
3
        assertEquals("plonk.pling", result[0]);
4
        assertEquals("plonk.baz.pling", result[0]);
4
        // and a little longer
5
        // and a little shorter
5
        result = m.mapFileName("foo.baz.bar");
6
        result = m.mapFileName("foobar");
6
        assertNotNull("Should match foo*bar", result);
7
        assertNotNull("Should match foo*bar", result);
7
        assertEquals("only one result for foo.baz.bar", 1, result.length);
8
        assertEquals("only one result for foobar", 1, result.length);
8
        assertEquals("plonk.baz.pling", result[0]);
9
        assertEquals("plonkpling", result[0]);
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.0
Clones locationClones are in the same method
Number of node comparisons39
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements7
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
                                                                                  
    9
    result = m.mapFileName("foo.baz.bar");
    6
    assertNotNull("Should match foo*bar", result);
    10
    assertNotNull("Should match foo*bar", result);
    7
    assertEquals("only one result for foo.bar", 1, result.length);
    7
    assertEquals("only one result for foo.bar", 1, result.length);
    12
    assertEquals("plonk.baz.pling", result[0]);
    Differences
    Expression1Expression2Difference
    assertEquals("only one result for foo.bar",1,result.length)assertEquals("plonk.baz.pling",result[0])ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression assertEquals("only one result for foo.bar",1,result.length) is a void method call, and thus it cannot be parameterized
    Expression assertEquals("plonk.baz.pling",result[0]) is a void method call, and thus it cannot be parameterized
    12
    assertEquals("plonk.baz.pling", result[0]);
    8
    assertEquals("plonk.pling", result[0]);
    8
    assertEquals("plonk.pling", result[0]);
    16
    assertEquals("plonkpling", result[0]);
    Differences
    Expression1Expression2Difference
    "plonk.pling""plonkpling"LITERAL_VALUE_MISMATCH
    16
    assertEquals("plonkpling", result[0]);
    9
    result = m.mapFileName("foo.baz.bar");
    9
    result = m.mapFileName("foo.baz.bar");
    13
    result = m.mapFileName("foobar");
    Differences
    Expression1Expression2Difference
    "foo.baz.bar""foobar"LITERAL_VALUE_MISMATCH
    13
    result = m.mapFileName("foobar");
    10
    assertNotNull("Should match foo*bar", result);
    10
    assertNotNull("Should match foo*bar", result);
    11
    assertEquals("only one result for foo.baz.bar", 1, result.length);
    11
    assertEquals("only one result for foo.baz.bar", 1, result.length);
                                                                                                      
    14
    assertNotNull("Should match foo*bar", result);
    12
    assertEquals("plonk.baz.pling", result[0]);
    12
    assertEquals("plonk.baz.pling", result[0]);
    15
    assertEquals("only one result for foobar", 1, result.length);
    Differences
    Expression1Expression2Difference
    assertEquals("plonk.baz.pling",result[0])assertEquals("only one result for foobar",1,result.length)ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression assertEquals("plonk.baz.pling",result[0]) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression assertEquals("only one result for foobar",1,result.length) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression assertEquals("plonk.baz.pling",result[0]) is a void method call, and thus it cannot be parameterized
    Expression assertEquals("only one result for foobar",1,result.length) is a void method call, and thus it cannot be parameterized
    15
    assertEquals("only one result for foobar", 1, result.length);
    Precondition Violations (7)
    Row Violation
    1Expression assertEquals("only one result for foo.bar",1,result.length) is a void method call, and thus it cannot be parameterized
    2Expression assertEquals("plonk.baz.pling",result[0]) is a void method call, and thus it cannot be parameterized
    3Expression assertEquals("plonk.baz.pling",result[0]) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression assertEquals("only one result for foobar",1,result.length) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression assertEquals("plonk.baz.pling",result[0]) is a void method call, and thus it cannot be parameterized
    6Expression assertEquals("only one result for foobar",1,result.length) is a void method call, and thus it cannot be parameterized
    7Clone fragment #1 returns variables , while Clone fragment #2 returns variables result