ZipLong zl = new ZipLong(0x12345678); ZipLong zl2 = new ZipLong(0x12345678); ZipLong zl3 = new ZipLong(0x87654321); assertTrue("reflexive", zl.equals(zl)); assertTrue("works", zl.equals(zl2)); assertTrue("works, part two", !zl.equals(zl3)); assertTrue("symmetric", zl2.equals(zl)); assertTrue("null handling", !zl.equals(null)); assertTrue("non ZipLong handling", !zl.equals(new Integer(0x1234)));
ZipShort zs = new ZipShort(0x1234); ZipShort zs2 = new ZipShort(0x1234); ZipShort zs3 = new ZipShort(0x5678); assertTrue("reflexive", zs.equals(zs)); assertTrue("works", zs.equals(zs2)); assertTrue("works, part two", !zs.equals(zs3)); assertTrue("symmetric", zs2.equals(zs)); assertTrue("null handling", !zs.equals(null)); assertTrue("non ZipShort handling", !zs.equals(new Integer(0x1234)));
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/zip/ZipLongTest.java File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/zip/ZipShortTest.java
Method name: void testEquals() Method name: void testEquals()
Number of AST nodes: 9 Number of AST nodes: 9
1
ZipLong zl = new ZipLong(0x12345678);
1
ZipShort zs = new ZipShort(0x1234);
2
        ZipLong zl2 = new ZipLong(0x12345678);
2
        ZipShort zs2 = new ZipShort(0x1234);
3
        ZipLong zl3 = new ZipLong(0x87654321);
3
        ZipShort zs3 = new ZipShort(0x5678);
4
        assertTrue("reflexive", zl.equals(zl));
4
        assertTrue("reflexive", zs.equals(zs));
5
        assertTrue("works", zl.equals(zl2));
5
        assertTrue("works", zs.equals(zs2));
6
        assertTrue("works, part two", !zl.equals(zl3));
6
        assertTrue("works, part two", !zs.equals(zs3));
7
        assertTrue("symmetric", zl2.equals(zl));
7
        assertTrue("symmetric", zs2.equals(zs));
8
        assertTrue("null handling", !zl.equals(null));
8
        assertTrue("null handling", !zs.equals(null));
9
        assertTrue("non ZipLong handling", !zl.equals(new Integer(0x1234)));
9
        assertTrue("non ZipShort handling", !zs.equals(new Integer(0x1234)));
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 different classes having the same super class
Number of node comparisons81
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements5
    Number of unmapped statements in the first code fragment4
    Number of unmapped statements in the second code fragment4
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
                                                                            
    1
    ZipShort zs = new ZipShort(0x1234);
    1
    ZipLong zl = new ZipLong(0x12345678);
                                                                                
                                                                              
    2
    ZipShort zs2 = new ZipShort(0x1234);
    2
    ZipLong zl2 = new ZipLong(0x12345678);
                                                                                  
                                                                              
    3
    ZipShort zs3 = new ZipShort(0x5678);
    3
    ZipLong zl3 = new ZipLong(0x87654321);
                                                                                  
    4
    assertTrue("reflexive", zl.equals(zl));
    4
    assertTrue("reflexive", zl.equals(zl));
    4
    assertTrue("reflexive", zs.equals(zs));
    Differences
    Expression1Expression2Difference
    zlzsVARIABLE_NAME_MISMATCH
    org.apache.tools.zip.ZipLongorg.apache.tools.zip.ZipShortVARIABLE_TYPE_MISMATCH
    zlzsVARIABLE_NAME_MISMATCH
    org.apache.tools.zip.ZipLongorg.apache.tools.zip.ZipShortVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.apache.tools.zip.ZipLong of variable zl does not match with type org.apache.tools.zip.ZipShort of variable zs
    • Make classes org.apache.tools.zip.ZipLong and org.apache.tools.zip.ZipShort extend a common superclass
    Type org.apache.tools.zip.ZipLong of variable zl does not match with type org.apache.tools.zip.ZipShort of variable zs
    • Make classes org.apache.tools.zip.ZipLong and org.apache.tools.zip.ZipShort extend a common superclass
    4
    assertTrue("reflexive", zs.equals(zs));
    5
    assertTrue("works", zl.equals(zl2));
    5
    assertTrue("works", zl.equals(zl2));
    5
    assertTrue("works", zs.equals(zs2));
    Differences
    Expression1Expression2Difference
    zl2zs2VARIABLE_NAME_MISMATCH
    org.apache.tools.zip.ZipLongorg.apache.tools.zip.ZipShortVARIABLE_TYPE_MISMATCH
    zlzsVARIABLE_NAME_MISMATCH
    org.apache.tools.zip.ZipLongorg.apache.tools.zip.ZipShortVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.apache.tools.zip.ZipLong of variable zl2 does not match with type org.apache.tools.zip.ZipShort of variable zs2
    • Make classes org.apache.tools.zip.ZipLong and org.apache.tools.zip.ZipShort extend a common superclass
    Type org.apache.tools.zip.ZipLong of variable zl does not match with type org.apache.tools.zip.ZipShort of variable zs
    • Make classes org.apache.tools.zip.ZipLong and org.apache.tools.zip.ZipShort extend a common superclass
    5
    assertTrue("works", zs.equals(zs2));
    6
    assertTrue("works, part two", !zl.equals(zl3));
    6
    assertTrue("works, part two", !zl.equals(zl3));
    6
    assertTrue("works, part two", !zs.equals(zs3));
    Differences
    Expression1Expression2Difference
    zl3zs3VARIABLE_NAME_MISMATCH
    org.apache.tools.zip.ZipLongorg.apache.tools.zip.ZipShortVARIABLE_TYPE_MISMATCH
    zlzsVARIABLE_NAME_MISMATCH
    org.apache.tools.zip.ZipLongorg.apache.tools.zip.ZipShortVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.apache.tools.zip.ZipLong of variable zl3 does not match with type org.apache.tools.zip.ZipShort of variable zs3
    • Make classes org.apache.tools.zip.ZipLong and org.apache.tools.zip.ZipShort extend a common superclass
    Type org.apache.tools.zip.ZipLong of variable zl does not match with type org.apache.tools.zip.ZipShort of variable zs
    • Make classes org.apache.tools.zip.ZipLong and org.apache.tools.zip.ZipShort extend a common superclass
    6
    assertTrue("works, part two", !zs.equals(zs3));
    7
    assertTrue("symmetric", zl2.equals(zl));
    7
    assertTrue("symmetric", zl2.equals(zl));
    7
    assertTrue("symmetric", zs2.equals(zs));
    Differences
    Expression1Expression2Difference
    zlzsVARIABLE_NAME_MISMATCH
    org.apache.tools.zip.ZipLongorg.apache.tools.zip.ZipShortVARIABLE_TYPE_MISMATCH
    zl2zs2VARIABLE_NAME_MISMATCH
    org.apache.tools.zip.ZipLongorg.apache.tools.zip.ZipShortVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.apache.tools.zip.ZipLong of variable zl does not match with type org.apache.tools.zip.ZipShort of variable zs
    • Make classes org.apache.tools.zip.ZipLong and org.apache.tools.zip.ZipShort extend a common superclass
    Type org.apache.tools.zip.ZipLong of variable zl2 does not match with type org.apache.tools.zip.ZipShort of variable zs2
    • Make classes org.apache.tools.zip.ZipLong and org.apache.tools.zip.ZipShort extend a common superclass
    7
    assertTrue("symmetric", zs2.equals(zs));
    8
    assertTrue("null handling", !zl.equals(null));
    8
    assertTrue("null handling", !zl.equals(null));
    8
    assertTrue("null handling", !zs.equals(null));
    Differences
    Expression1Expression2Difference
    zlzsVARIABLE_NAME_MISMATCH
    org.apache.tools.zip.ZipLongorg.apache.tools.zip.ZipShortVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.apache.tools.zip.ZipLong of variable zl does not match with type org.apache.tools.zip.ZipShort of variable zs
    • Make classes org.apache.tools.zip.ZipLong and org.apache.tools.zip.ZipShort extend a common superclass
    8
    assertTrue("null handling", !zs.equals(null));
                                                                                                                                                  
    9
    assertTrue("non ZipShort handling", !zs.equals(new Integer(0x1234)));
    9
    assertTrue("non ZipLong handling", !zl.equals(new Integer(0x1234)));
                                                                                                                                                
    Precondition Violations (9)
    Row Violation
    1Type org.apache.tools.zip.ZipLong of variable zl does not match with type org.apache.tools.zip.ZipShort of variable zs
    2Type org.apache.tools.zip.ZipLong of variable zl does not match with type org.apache.tools.zip.ZipShort of variable zs
    3Type org.apache.tools.zip.ZipLong of variable zl2 does not match with type org.apache.tools.zip.ZipShort of variable zs2
    4Type org.apache.tools.zip.ZipLong of variable zl does not match with type org.apache.tools.zip.ZipShort of variable zs
    5Type org.apache.tools.zip.ZipLong of variable zl3 does not match with type org.apache.tools.zip.ZipShort of variable zs3
    6Type org.apache.tools.zip.ZipLong of variable zl does not match with type org.apache.tools.zip.ZipShort of variable zs
    7Type org.apache.tools.zip.ZipLong of variable zl does not match with type org.apache.tools.zip.ZipShort of variable zs
    8Type org.apache.tools.zip.ZipLong of variable zl2 does not match with type org.apache.tools.zip.ZipShort of variable zs2
    9Type org.apache.tools.zip.ZipLong of variable zl does not match with type org.apache.tools.zip.ZipShort of variable zs