ListedHashTree tree1 = new ListedHashTree("abcd"); ListedHashTree tree2 = new ListedHashTree("abcd"); ListedHashTree tree3 = new ListedHashTree("abcde"); ListedHashTree tree4 = new ListedHashTree("abcde"); assertTrue(tree1.equals(tree1)); assertTrue(tree1.equals(tree2)); assertTrue(tree2.equals(tree1)); assertTrue(tree2.equals(tree2)); assertTrue(tree1.hashCode() == tree2.hashCode()); assertTrue(tree3.equals(tree3)); assertTrue(tree3.equals(tree4)); assertTrue(tree4.equals(tree3)); assertTrue(tree4.equals(tree4)); assertTrue(tree3.hashCode() == tree4.hashCode()); assertNotSame(tree1, tree2); assertNotSame(tree1, tree3);
HashTree tree1 = new HashTree("abcd"); HashTree tree2 = new HashTree("abcd"); HashTree tree3 = new HashTree("abcde"); HashTree tree4 = new HashTree("abcde"); assertTrue(tree1.equals(tree1)); assertTrue(tree1.equals(tree2)); assertTrue(tree2.equals(tree1)); assertTrue(tree2.equals(tree2)); assertTrue(tree1.hashCode() == tree2.hashCode()); assertTrue(tree3.equals(tree3)); assertTrue(tree3.equals(tree4)); assertTrue(tree4.equals(tree3)); assertTrue(tree4.equals(tree4)); assertTrue(tree3.hashCode() == tree4.hashCode()); assertNotSame(tree1, tree2); assertNotSame(tree1, tree3);
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/test/src/org/apache/jorphan/collections/PackageTest.java File path: /jakarta-jmeter-2.3.2/test/src/org/apache/jorphan/collections/PackageTest.java
Method name: void testEqualsAndHashCode2() Method name: void testEqualsAndHashCode1()
Number of AST nodes: 16 Number of AST nodes: 16
1
ListedHashTree tree1 = new ListedHashTree("abcd");
1
HashTree tree1 = new HashTree("abcd");
2
			ListedHashTree tree2 = new ListedHashTree("abcd");
2
			HashTree tree2 = new HashTree("abcd");
3
			ListedHashTree tree3 = new ListedHashTree("abcde");
3
			HashTree tree3 = new HashTree("abcde");
4
			ListedHashTree tree4 = new ListedHashTree("abcde");
4
			HashTree tree4 = new HashTree("abcde");
5
			assertTrue(tree1.equals(tree1));
5
			assertTrue(tree1.equals(tree1));
6
			assertTrue(tree1.equals(tree2));
6
			assertTrue(tree1.equals(tree2));
7
			assertTrue(tree2.equals(tree1));
7
			assertTrue(tree2.equals(tree1));
8
			assertTrue(tree2.equals(tree2));
8
			assertTrue(tree2.equals(tree2));
9
			assertTrue(tree1.hashCode() == tree2.hashCode());
9
			assertTrue(tree1.hashCode() == tree2.hashCode());
10
			assertTrue(tree3.equals(tree3));
10
			assertTrue(tree3.equals(tree3));
11
			assertTrue(tree3.equals(tree4));
11
			assertTrue(tree3.equals(tree4));
12
			assertTrue(tree4.equals(tree3));
12
			assertTrue(tree4.equals(tree3));
13
			assertTrue(tree4.equals(tree4));
13
			assertTrue(tree4.equals(tree4));
14
			assertTrue(tree3.hashCode() == tree4.hashCode());
14
			assertTrue(tree3.hashCode() == tree4.hashCode());
15
			assertNotSame(tree1, tree2);
15
			assertNotSame(tree1, tree2);
16
			assertNotSame(tree1, tree3);
16
			assertNotSame(tree1, tree3);
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 declared in the same class
Number of node comparisons131
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements16
    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
    ListedHashTree tree1 = new ListedHashTree("abcd");
    1
    ListedHashTree tree1 = new ListedHashTree("abcd");
    2
    HashTree tree2 = new HashTree("abcd");
    Differences
    Expression1Expression2Difference
    org.apache.jorphan.collections.ListedHashTreeorg.apache.jorphan.collections.HashTreeSUBCLASS_TYPE_MISMATCH
    tree1tree2VARIABLE_NAME_MISMATCH
    org.apache.jorphan.collections.ListedHashTreeorg.apache.jorphan.collections.HashTreeSUBCLASS_TYPE_MISMATCH
    org.apache.jorphan.collections.ListedHashTreeorg.apache.jorphan.collections.HashTreeSUBCLASS_TYPE_MISMATCH
    2
    HashTree tree2 = new HashTree("abcd");
    2
    ListedHashTree tree2 = new ListedHashTree("abcd");
    2
    ListedHashTree tree2 = new ListedHashTree("abcd");
    1
    HashTree tree1 = new HashTree("abcd");
    Differences
    Expression1Expression2Difference
    org.apache.jorphan.collections.ListedHashTreeorg.apache.jorphan.collections.HashTreeSUBCLASS_TYPE_MISMATCH
    tree2tree1VARIABLE_NAME_MISMATCH
    org.apache.jorphan.collections.ListedHashTreeorg.apache.jorphan.collections.HashTreeSUBCLASS_TYPE_MISMATCH
    org.apache.jorphan.collections.ListedHashTreeorg.apache.jorphan.collections.HashTreeSUBCLASS_TYPE_MISMATCH
    1
    HashTree tree1 = new HashTree("abcd");
    3
    ListedHashTree tree3 = new ListedHashTree("abcde");
    3
    ListedHashTree tree3 = new ListedHashTree("abcde");
    4
    HashTree tree4 = new HashTree("abcde");
    Differences
    Expression1Expression2Difference
    org.apache.jorphan.collections.ListedHashTreeorg.apache.jorphan.collections.HashTreeSUBCLASS_TYPE_MISMATCH
    tree3tree4VARIABLE_NAME_MISMATCH
    org.apache.jorphan.collections.ListedHashTreeorg.apache.jorphan.collections.HashTreeSUBCLASS_TYPE_MISMATCH
    org.apache.jorphan.collections.ListedHashTreeorg.apache.jorphan.collections.HashTreeSUBCLASS_TYPE_MISMATCH
    4
    HashTree tree4 = new HashTree("abcde");
    4
    ListedHashTree tree4 = new ListedHashTree("abcde");
    4
    ListedHashTree tree4 = new ListedHashTree("abcde");
    3
    HashTree tree3 = new HashTree("abcde");
    Differences
    Expression1Expression2Difference
    org.apache.jorphan.collections.ListedHashTreeorg.apache.jorphan.collections.HashTreeSUBCLASS_TYPE_MISMATCH
    tree4tree3VARIABLE_NAME_MISMATCH
    org.apache.jorphan.collections.ListedHashTreeorg.apache.jorphan.collections.HashTreeSUBCLASS_TYPE_MISMATCH
    org.apache.jorphan.collections.ListedHashTreeorg.apache.jorphan.collections.HashTreeSUBCLASS_TYPE_MISMATCH
    3
    HashTree tree3 = new HashTree("abcde");
    5
    assertTrue(tree1.equals(tree1));
    5
    assertTrue(tree1.equals(tree1));
    6
    assertTrue(tree1.equals(tree2));
    Differences
    Expression1Expression2Difference
    tree1tree2VARIABLE_NAME_MISMATCH
    org.apache.jorphan.collections.ListedHashTreeorg.apache.jorphan.collections.HashTreeSUBCLASS_TYPE_MISMATCH
    org.apache.jorphan.collections.ListedHashTreeorg.apache.jorphan.collections.HashTreeSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression tree1 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression tree2 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6
    assertTrue(tree1.equals(tree2));
    6
    assertTrue(tree1.equals(tree2));
    6
    assertTrue(tree1.equals(tree2));
    7
    assertTrue(tree2.equals(tree1));
    Differences
    Expression1Expression2Difference
    tree2tree1VARIABLE_NAME_MISMATCH
    org.apache.jorphan.collections.ListedHashTreeorg.apache.jorphan.collections.HashTreeSUBCLASS_TYPE_MISMATCH
    tree1tree2VARIABLE_NAME_MISMATCH
    org.apache.jorphan.collections.ListedHashTreeorg.apache.jorphan.collections.HashTreeSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression tree1 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression tree2 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7
    assertTrue(tree2.equals(tree1));
    7
    assertTrue(tree2.equals(tree1));
    7
    assertTrue(tree2.equals(tree1));
    8
    assertTrue(tree2.equals(tree2));
    Differences
    Expression1Expression2Difference
    tree1tree2VARIABLE_NAME_MISMATCH
    org.apache.jorphan.collections.ListedHashTreeorg.apache.jorphan.collections.HashTreeSUBCLASS_TYPE_MISMATCH
    org.apache.jorphan.collections.ListedHashTreeorg.apache.jorphan.collections.HashTreeSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression tree1 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression tree2 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8
    assertTrue(tree2.equals(tree2));
    8
    assertTrue(tree2.equals(tree2));
    8
    assertTrue(tree2.equals(tree2));
    5
    assertTrue(tree1.equals(tree1));
    Differences
    Expression1Expression2Difference
    tree2tree1VARIABLE_NAME_MISMATCH
    org.apache.jorphan.collections.ListedHashTreeorg.apache.jorphan.collections.HashTreeSUBCLASS_TYPE_MISMATCH
    tree2tree1VARIABLE_NAME_MISMATCH
    org.apache.jorphan.collections.ListedHashTreeorg.apache.jorphan.collections.HashTreeSUBCLASS_TYPE_MISMATCH
    5
    assertTrue(tree1.equals(tree1));
    9
    assertTrue(tree1.hashCode() == tree2.hashCode());
    9
    assertTrue(tree1.hashCode() == tree2.hashCode());
    9
    assertTrue(tree1.hashCode() == tree2.hashCode());
    Differences
    Expression1Expression2Difference
    org.apache.jorphan.collections.ListedHashTreeorg.apache.jorphan.collections.HashTreeSUBCLASS_TYPE_MISMATCH
    org.apache.jorphan.collections.ListedHashTreeorg.apache.jorphan.collections.HashTreeSUBCLASS_TYPE_MISMATCH
    9
    assertTrue(tree1.hashCode() == tree2.hashCode());
    10
    assertTrue(tree3.equals(tree3));
    10
    assertTrue(tree3.equals(tree3));
    11
    assertTrue(tree3.equals(tree4));
    Differences
    Expression1Expression2Difference
    tree3tree4VARIABLE_NAME_MISMATCH
    org.apache.jorphan.collections.ListedHashTreeorg.apache.jorphan.collections.HashTreeSUBCLASS_TYPE_MISMATCH
    org.apache.jorphan.collections.ListedHashTreeorg.apache.jorphan.collections.HashTreeSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression tree3 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression tree4 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    11
    assertTrue(tree3.equals(tree4));
    11
    assertTrue(tree3.equals(tree4));
    11
    assertTrue(tree3.equals(tree4));
    12
    assertTrue(tree4.equals(tree3));
    Differences
    Expression1Expression2Difference
    tree4tree3VARIABLE_NAME_MISMATCH
    org.apache.jorphan.collections.ListedHashTreeorg.apache.jorphan.collections.HashTreeSUBCLASS_TYPE_MISMATCH
    tree3tree4VARIABLE_NAME_MISMATCH
    org.apache.jorphan.collections.ListedHashTreeorg.apache.jorphan.collections.HashTreeSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression tree3 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression tree4 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    12
    assertTrue(tree4.equals(tree3));
    12
    assertTrue(tree4.equals(tree3));
    12
    assertTrue(tree4.equals(tree3));
    13
    assertTrue(tree4.equals(tree4));
    Differences
    Expression1Expression2Difference
    tree3tree4VARIABLE_NAME_MISMATCH
    org.apache.jorphan.collections.ListedHashTreeorg.apache.jorphan.collections.HashTreeSUBCLASS_TYPE_MISMATCH
    org.apache.jorphan.collections.ListedHashTreeorg.apache.jorphan.collections.HashTreeSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression tree3 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression tree4 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    13
    assertTrue(tree4.equals(tree4));
    13
    assertTrue(tree4.equals(tree4));
    13
    assertTrue(tree4.equals(tree4));
    10
    assertTrue(tree3.equals(tree3));
    Differences
    Expression1Expression2Difference
    tree4tree3VARIABLE_NAME_MISMATCH
    org.apache.jorphan.collections.ListedHashTreeorg.apache.jorphan.collections.HashTreeSUBCLASS_TYPE_MISMATCH
    tree4tree3VARIABLE_NAME_MISMATCH
    org.apache.jorphan.collections.ListedHashTreeorg.apache.jorphan.collections.HashTreeSUBCLASS_TYPE_MISMATCH
    10
    assertTrue(tree3.equals(tree3));
    14
    assertTrue(tree3.hashCode() == tree4.hashCode());
    14
    assertTrue(tree3.hashCode() == tree4.hashCode());
    14
    assertTrue(tree3.hashCode() == tree4.hashCode());
    Differences
    Expression1Expression2Difference
    org.apache.jorphan.collections.ListedHashTreeorg.apache.jorphan.collections.HashTreeSUBCLASS_TYPE_MISMATCH
    org.apache.jorphan.collections.ListedHashTreeorg.apache.jorphan.collections.HashTreeSUBCLASS_TYPE_MISMATCH
    14
    assertTrue(tree3.hashCode() == tree4.hashCode());
    15
    assertNotSame(tree1, tree2);
    15
    assertNotSame(tree1, tree2);
    15
    assertNotSame(tree1, tree2);
    Differences
    Expression1Expression2Difference
    org.apache.jorphan.collections.ListedHashTreeorg.apache.jorphan.collections.HashTreeSUBCLASS_TYPE_MISMATCH
    org.apache.jorphan.collections.ListedHashTreeorg.apache.jorphan.collections.HashTreeSUBCLASS_TYPE_MISMATCH
    15
    assertNotSame(tree1, tree2);
    16
    assertNotSame(tree1, tree3);
    16
    assertNotSame(tree1, tree3);
    16
    assertNotSame(tree1, tree3);
    Differences
    Expression1Expression2Difference
    org.apache.jorphan.collections.ListedHashTreeorg.apache.jorphan.collections.HashTreeSUBCLASS_TYPE_MISMATCH
    org.apache.jorphan.collections.ListedHashTreeorg.apache.jorphan.collections.HashTreeSUBCLASS_TYPE_MISMATCH
    16
    assertNotSame(tree1, tree3);
    Precondition Violations (13)
    Row Violation
    1Expression tree1 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression tree2 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression tree1 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression tree2 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression tree1 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression tree2 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression tree3 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Expression tree4 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    9Expression tree3 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10Expression tree4 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    11Expression tree3 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    12Expression tree4 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    13Clone fragment #1 returns variables tree1, tree3, tree4, tree2 , while Clone fragment #2 returns variables tree1, tree4, tree2, tree3