DefaultKeyedValueDataset d1 = new DefaultKeyedValueDataset("Test", new Double(45.5)); DefaultKeyedValueDataset d2 = new DefaultKeyedValueDataset("Test", new Double(45.5)); assertTrue(d1.equals(d2)); assertTrue(d2.equals(d1)); d1 = new DefaultKeyedValueDataset("Test 1", new Double(45.5)); d2 = new DefaultKeyedValueDataset("Test 2", new Double(45.5)); assertFalse(d1.equals(d2)); d1 = new DefaultKeyedValueDataset("Test", new Double(45.5)); d2 = new DefaultKeyedValueDataset("Test", new Double(45.6)); assertFalse(d1.equals(d2));
DefaultKeyedValue v1 = new DefaultKeyedValue("Test", new Double(45.5)); DefaultKeyedValue v2 = new DefaultKeyedValue("Test", new Double(45.5)); assertTrue(v1.equals(v2)); assertTrue(v2.equals(v1)); v1 = new DefaultKeyedValue("Test 1", new Double(45.5)); v2 = new DefaultKeyedValue("Test 2", new Double(45.5)); assertFalse(v1.equals(v2)); v1 = new DefaultKeyedValue("Test", new Double(45.5)); v2 = new DefaultKeyedValue("Test", new Double(45.6)); assertFalse(v1.equals(v2));
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/tests/org/jfree/data/general/junit/DefaultKeyedValueDatasetTests.java File path: /jfreechart-1.0.10/tests/org/jfree/data/junit/DefaultKeyedValueTests.java
Method name: void testEquals() Method name: void testEquals()
Number of AST nodes: 10 Number of AST nodes: 10
1
DefaultKeyedValueDataset d1 
1
DefaultKeyedValue
2
            = new DefaultKeyedValueDataset("Test", new Double(45.5));
2
 v1 = new DefaultKeyedValue("Test", new Double(45.5));
3
        DefaultKeyedValueDataset d2 
3
        DefaultKeyedValue
4
            = new DefaultKeyedValueDataset("Test", new Double(45.5));
4
 v2 = new DefaultKeyedValue("Test", new Double(45.5));
5
        assertTrue(d1.equals(d2));
5
        assertTrue(v1.equals(v2));
6
        assertTrue(d2.equals(d1));
6
        assertTrue(v2.equals(v1));
7
        d1 = new DefaultKeyedValueDataset("Test 1", new Double(45.5));
7
        v1 = new DefaultKeyedValue("Test 1", new Double(45.5));
8
        d2 = new DefaultKeyedValueDataset("Test 2", new Double(45.5));
8
        v2 = new DefaultKeyedValue("Test 2", new Double(45.5));
9
        assertFalse(d1.equals(d2));
9
        assertFalse(v1.equals(v2));
10
        d1 = new DefaultKeyedValueDataset("Test", new Double(45.5));
10
        v1 = new DefaultKeyedValue("Test", new Double(45.5));
11
        d2 = new DefaultKeyedValueDataset("Test", new Double(45.6));
11
        v2 = new DefaultKeyedValue("Test", new Double(45.6));
12
        assertFalse(d1.equals(d2));
12
        assertFalse(v1.equals(v2));
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 comparisons35
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements10
    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
    DefaultKeyedValueDataset d1 = new DefaultKeyedValueDataset("Test", new Double(45.5));
    1
    DefaultKeyedValueDataset d1 = new DefaultKeyedValueDataset("Test", new Double(45.5));
    1
    DefaultKeyedValue v1 = new DefaultKeyedValue("Test", new Double(45.5));
    Differences
    Expression1Expression2Difference
    org.jfree.data.general.DefaultKeyedValueDatasetorg.jfree.data.DefaultKeyedValueSUBCLASS_TYPE_MISMATCH
    d1v1VARIABLE_NAME_MISMATCH
    org.jfree.data.general.DefaultKeyedValueDatasetorg.jfree.data.DefaultKeyedValueSUBCLASS_TYPE_MISMATCH
    org.jfree.data.general.DefaultKeyedValueDatasetorg.jfree.data.DefaultKeyedValueSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression new DefaultKeyedValueDataset("Test",new Double(45.5)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression new DefaultKeyedValue("Test",new Double(45.5)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    1
    DefaultKeyedValue v1 = new DefaultKeyedValue("Test", new Double(45.5));
    2
    DefaultKeyedValueDataset d2 = new DefaultKeyedValueDataset("Test", new Double(45.5));
    2
    DefaultKeyedValueDataset d2 = new DefaultKeyedValueDataset("Test", new Double(45.5));
    2
    DefaultKeyedValue v2 = new DefaultKeyedValue("Test", new Double(45.5));
    Differences
    Expression1Expression2Difference
    org.jfree.data.general.DefaultKeyedValueDatasetorg.jfree.data.DefaultKeyedValueSUBCLASS_TYPE_MISMATCH
    d2v2VARIABLE_NAME_MISMATCH
    org.jfree.data.general.DefaultKeyedValueDatasetorg.jfree.data.DefaultKeyedValueSUBCLASS_TYPE_MISMATCH
    org.jfree.data.general.DefaultKeyedValueDatasetorg.jfree.data.DefaultKeyedValueSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression new DefaultKeyedValueDataset("Test",new Double(45.5)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression new DefaultKeyedValue("Test",new Double(45.5)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2
    DefaultKeyedValue v2 = new DefaultKeyedValue("Test", new Double(45.5));
    3
    assertTrue(d1.equals(d2));
    3
    assertTrue(d1.equals(d2));
    3
    assertTrue(v1.equals(v2));
    Differences
    Expression1Expression2Difference
    d2v2VARIABLE_NAME_MISMATCH
    org.jfree.data.general.DefaultKeyedValueDatasetorg.jfree.data.DefaultKeyedValueSUBCLASS_TYPE_MISMATCH
    d1v1VARIABLE_NAME_MISMATCH
    org.jfree.data.general.DefaultKeyedValueDatasetorg.jfree.data.DefaultKeyedValueSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression d2 cannot be unified with expression v2 , because common superclass type org.jfree.data.KeyedValue cannot be passed as an argument to public boolean equals(java.lang.Object)
    Expression d2 cannot be unified with expression v2 , because common superclass org.jfree.data.KeyedValue does not declare member(s) public boolean equals(java.lang.Object)
    Expression d1 cannot be unified with expression v1 , because common superclass org.jfree.data.KeyedValue does not declare member(s) public boolean equals(java.lang.Object)
    3
    assertTrue(v1.equals(v2));
    4
    assertTrue(d2.equals(d1));
    4
    assertTrue(d2.equals(d1));
    4
    assertTrue(v2.equals(v1));
    Differences
    Expression1Expression2Difference
    d1v1VARIABLE_NAME_MISMATCH
    org.jfree.data.general.DefaultKeyedValueDatasetorg.jfree.data.DefaultKeyedValueSUBCLASS_TYPE_MISMATCH
    d2v2VARIABLE_NAME_MISMATCH
    org.jfree.data.general.DefaultKeyedValueDatasetorg.jfree.data.DefaultKeyedValueSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression d1 cannot be unified with expression v1 , because common superclass type org.jfree.data.KeyedValue cannot be passed as an argument to public boolean equals(java.lang.Object)
    Expression d1 cannot be unified with expression v1 , because common superclass org.jfree.data.KeyedValue does not declare member(s) public boolean equals(java.lang.Object)
    Expression d2 cannot be unified with expression v2 , because common superclass org.jfree.data.KeyedValue does not declare member(s) public boolean equals(java.lang.Object)
    4
    assertTrue(v2.equals(v1));
    5
    d1 = new DefaultKeyedValueDataset("Test 1", new Double(45.5));
    5
    d1 = new DefaultKeyedValueDataset("Test 1", new Double(45.5));
    5
    v1 = new DefaultKeyedValue("Test 1", new Double(45.5));
    Differences
    Expression1Expression2Difference
    d1v1VARIABLE_NAME_MISMATCH
    org.jfree.data.general.DefaultKeyedValueDatasetorg.jfree.data.DefaultKeyedValueSUBCLASS_TYPE_MISMATCH
    org.jfree.data.general.DefaultKeyedValueDatasetorg.jfree.data.DefaultKeyedValueSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression new DefaultKeyedValueDataset("Test 1",new Double(45.5)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression new DefaultKeyedValue("Test 1",new Double(45.5)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5
    v1 = new DefaultKeyedValue("Test 1", new Double(45.5));
    6
    d2 = new DefaultKeyedValueDataset("Test 2", new Double(45.5));
    6
    d2 = new DefaultKeyedValueDataset("Test 2", new Double(45.5));
    6
    v2 = new DefaultKeyedValue("Test 2", new Double(45.5));
    Differences
    Expression1Expression2Difference
    d2v2VARIABLE_NAME_MISMATCH
    org.jfree.data.general.DefaultKeyedValueDatasetorg.jfree.data.DefaultKeyedValueSUBCLASS_TYPE_MISMATCH
    org.jfree.data.general.DefaultKeyedValueDatasetorg.jfree.data.DefaultKeyedValueSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression new DefaultKeyedValueDataset("Test 2",new Double(45.5)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression new DefaultKeyedValue("Test 2",new Double(45.5)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6
    v2 = new DefaultKeyedValue("Test 2", new Double(45.5));
    7
    assertFalse(d1.equals(d2));
    7
    assertFalse(d1.equals(d2));
    7
    assertFalse(v1.equals(v2));
    Differences
    Expression1Expression2Difference
    d2v2VARIABLE_NAME_MISMATCH
    org.jfree.data.general.DefaultKeyedValueDatasetorg.jfree.data.DefaultKeyedValueSUBCLASS_TYPE_MISMATCH
    d1v1VARIABLE_NAME_MISMATCH
    org.jfree.data.general.DefaultKeyedValueDatasetorg.jfree.data.DefaultKeyedValueSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression d2 cannot be unified with expression v2 , because common superclass type org.jfree.data.KeyedValue cannot be passed as an argument to public boolean equals(java.lang.Object)
    Expression d2 cannot be unified with expression v2 , because common superclass org.jfree.data.KeyedValue does not declare member(s) public boolean equals(java.lang.Object)
    Expression d1 cannot be unified with expression v1 , because common superclass org.jfree.data.KeyedValue does not declare member(s) public boolean equals(java.lang.Object)
    7
    assertFalse(v1.equals(v2));
    8
    d1 = new DefaultKeyedValueDataset("Test", new Double(45.5));
    8
    d1 = new DefaultKeyedValueDataset("Test", new Double(45.5));
    8
    v1 = new DefaultKeyedValue("Test", new Double(45.5));
    Differences
    Expression1Expression2Difference
    d1v1VARIABLE_NAME_MISMATCH
    org.jfree.data.general.DefaultKeyedValueDatasetorg.jfree.data.DefaultKeyedValueSUBCLASS_TYPE_MISMATCH
    org.jfree.data.general.DefaultKeyedValueDatasetorg.jfree.data.DefaultKeyedValueSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression new DefaultKeyedValueDataset("Test",new Double(45.5)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression new DefaultKeyedValue("Test",new Double(45.5)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8
    v1 = new DefaultKeyedValue("Test", new Double(45.5));
    9
    d2 = new DefaultKeyedValueDataset("Test", new Double(45.6));
    9
    d2 = new DefaultKeyedValueDataset("Test", new Double(45.6));
    9
    v2 = new DefaultKeyedValue("Test", new Double(45.6));
    Differences
    Expression1Expression2Difference
    d2v2VARIABLE_NAME_MISMATCH
    org.jfree.data.general.DefaultKeyedValueDatasetorg.jfree.data.DefaultKeyedValueSUBCLASS_TYPE_MISMATCH
    org.jfree.data.general.DefaultKeyedValueDatasetorg.jfree.data.DefaultKeyedValueSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression new DefaultKeyedValueDataset("Test",new Double(45.6)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression new DefaultKeyedValue("Test",new Double(45.6)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    9
    v2 = new DefaultKeyedValue("Test", new Double(45.6));
    10
    assertFalse(d1.equals(d2));
    10
    assertFalse(d1.equals(d2));
    10
    assertFalse(v1.equals(v2));
    Differences
    Expression1Expression2Difference
    d2v2VARIABLE_NAME_MISMATCH
    org.jfree.data.general.DefaultKeyedValueDatasetorg.jfree.data.DefaultKeyedValueSUBCLASS_TYPE_MISMATCH
    d1v1VARIABLE_NAME_MISMATCH
    org.jfree.data.general.DefaultKeyedValueDatasetorg.jfree.data.DefaultKeyedValueSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression d2 cannot be unified with expression v2 , because common superclass type org.jfree.data.KeyedValue cannot be passed as an argument to public boolean equals(java.lang.Object)
    Expression d2 cannot be unified with expression v2 , because common superclass org.jfree.data.KeyedValue does not declare member(s) public boolean equals(java.lang.Object)
    Expression d1 cannot be unified with expression v1 , because common superclass org.jfree.data.KeyedValue does not declare member(s) public boolean equals(java.lang.Object)
    10
    assertFalse(v1.equals(v2));
    Precondition Violations (24)
    Row Violation
    1Expression new DefaultKeyedValueDataset("Test",new Double(45.5)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression new DefaultKeyedValue("Test",new Double(45.5)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression new DefaultKeyedValueDataset("Test",new Double(45.5)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression new DefaultKeyedValue("Test",new Double(45.5)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression d2 cannot be unified with expression v2 , because common superclass type org.jfree.data.KeyedValue cannot be passed as an argument to public boolean equals(java.lang.Object)
    6Expression d2 cannot be unified with expression v2 , because common superclass org.jfree.data.KeyedValue does not declare member(s) public boolean equals(java.lang.Object)
    7Expression d1 cannot be unified with expression v1 , because common superclass org.jfree.data.KeyedValue does not declare member(s) public boolean equals(java.lang.Object)
    8Expression d1 cannot be unified with expression v1 , because common superclass type org.jfree.data.KeyedValue cannot be passed as an argument to public boolean equals(java.lang.Object)
    9Expression d1 cannot be unified with expression v1 , because common superclass org.jfree.data.KeyedValue does not declare member(s) public boolean equals(java.lang.Object)
    10Expression d2 cannot be unified with expression v2 , because common superclass org.jfree.data.KeyedValue does not declare member(s) public boolean equals(java.lang.Object)
    11Expression new DefaultKeyedValueDataset("Test 1",new Double(45.5)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    12Expression new DefaultKeyedValue("Test 1",new Double(45.5)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    13Expression new DefaultKeyedValueDataset("Test 2",new Double(45.5)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    14Expression new DefaultKeyedValue("Test 2",new Double(45.5)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    15Expression d2 cannot be unified with expression v2 , because common superclass type org.jfree.data.KeyedValue cannot be passed as an argument to public boolean equals(java.lang.Object)
    16Expression d2 cannot be unified with expression v2 , because common superclass org.jfree.data.KeyedValue does not declare member(s) public boolean equals(java.lang.Object)
    17Expression d1 cannot be unified with expression v1 , because common superclass org.jfree.data.KeyedValue does not declare member(s) public boolean equals(java.lang.Object)
    18Expression new DefaultKeyedValueDataset("Test",new Double(45.5)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    19Expression new DefaultKeyedValue("Test",new Double(45.5)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    20Expression new DefaultKeyedValueDataset("Test",new Double(45.6)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    21Expression new DefaultKeyedValue("Test",new Double(45.6)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    22Expression d2 cannot be unified with expression v2 , because common superclass type org.jfree.data.KeyedValue cannot be passed as an argument to public boolean equals(java.lang.Object)
    23Expression d2 cannot be unified with expression v2 , because common superclass org.jfree.data.KeyedValue does not declare member(s) public boolean equals(java.lang.Object)
    24Expression d1 cannot be unified with expression v1 , because common superclass org.jfree.data.KeyedValue does not declare member(s) public boolean equals(java.lang.Object)