assertFalse(tree1.equals(tree2)); assertFalse(tree2.equals(tree1));// Check reflexive if (tree1.hashCode() == tree2.hashCode()) { // This is not a requirement System.out.println("WARN: unequal HashTrees should not have equal hashCodes"); }
assertFalse(tree1.equals(tree2)); assertFalse(tree2.equals(tree1)); if (tree1.hashCode() == tree2.hashCode()) { // This is not a requirement System.out.println("WARN: unequal ListedHashTrees should not have equal hashcodes"); }
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 testEqualsAndHashCode1() Method name: void testEqualsAndHashCode2()
Number of AST nodes: 4 Number of AST nodes: 4
1
assertFalse(tree1.equals(tree2));
1
assertFalse(tree1.equals(tree2));
2
			assertFalse(tree2.equals(tree1));// Check reflexive
2
			assertFalse(tree2.equals(tree1));
3
			if (tree1.hashCode() == tree2.hashCode()) {
3
			if (tree1.hashCode() == tree2.hashCode()) {
4
				// This is not a requirement
4
				// This is not a requirement
5
				System.out.println("WARN: unequal HashTrees should not have equal hashCodes");
5
				System.out.println("WARN: unequal ListedHashTrees should not have equal hashcodes");
6
			}
6
			}
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.2
Clones locationClones are declared in the same class
Number of node comparisons8
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements4
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)18.4
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    27
    assertFalse(tree1.equals(tree2));
    27
    assertFalse(tree1.equals(tree2));
    36
    assertFalse(tree1.equals(tree2));
    Differences
    Expression1Expression2Difference
    org.apache.jorphan.collections.HashTreeorg.apache.jorphan.collections.ListedHashTreeSUBCLASS_TYPE_MISMATCH
    org.apache.jorphan.collections.HashTreeorg.apache.jorphan.collections.ListedHashTreeSUBCLASS_TYPE_MISMATCH
    36
    assertFalse(tree1.equals(tree2));
    28
    assertFalse(tree2.equals(tree1));
    28
    assertFalse(tree2.equals(tree1));
    37
    assertFalse(tree2.equals(tree1));
    Differences
    Expression1Expression2Difference
    org.apache.jorphan.collections.HashTreeorg.apache.jorphan.collections.ListedHashTreeSUBCLASS_TYPE_MISMATCH
    org.apache.jorphan.collections.HashTreeorg.apache.jorphan.collections.ListedHashTreeSUBCLASS_TYPE_MISMATCH
    37
    assertFalse(tree2.equals(tree1));
    29
    if (tree1.hashCode() == tree2.hashCode())
    29
    if (tree1.hashCode() == tree2.hashCode())
    38
    if (tree1.hashCode() == tree2.hashCode())
    Differences
    Expression1Expression2Difference
    org.apache.jorphan.collections.HashTreeorg.apache.jorphan.collections.ListedHashTreeSUBCLASS_TYPE_MISMATCH
    org.apache.jorphan.collections.HashTreeorg.apache.jorphan.collections.ListedHashTreeSUBCLASS_TYPE_MISMATCH
    38
    if (tree1.hashCode() == tree2.hashCode())
    30
    System.out.println("WARN: unequal HashTrees should not have equal hashCodes");
    30
    System.out.println("WARN: unequal HashTrees should not have equal hashCodes");
    39
    System.out.println("WARN: unequal ListedHashTrees should not have equal hashcodes");
    Differences
    Expression1Expression2Difference
    "WARN: unequal HashTrees should not have equal hashCodes""WARN: unequal ListedHashTrees should not have equal hashcodes"LITERAL_VALUE_MISMATCH
    39
    System.out.println("WARN: unequal ListedHashTrees should not have equal hashcodes");
    Precondition Violations (0)
    Row Violation