OHLCSeriesCollection c1 = new OHLCSeriesCollection(); OHLCSeriesCollection c2 = new OHLCSeriesCollection(); assertEquals(c1, c2); // add a series OHLCSeries s1 = new OHLCSeries("Series"); s1.add(new Year(2006), 1.0, 1.1, 1.2, 1.3); c1.addSeries(s1); assertFalse(c1.equals(c2)); OHLCSeries s2 = new OHLCSeries("Series"); s2.add(new Year(2006), 1.0, 1.1, 1.2, 1.3); c2.addSeries(s2); assertTrue(c1.equals(c2)); // add an empty series c1.addSeries(new OHLCSeries("Empty Series")); assertFalse(c1.equals(c2)); c2.addSeries(new OHLCSeries("Empty Series")); assertTrue(c1.equals(c2));
XYIntervalSeriesCollection c1 = new XYIntervalSeriesCollection(); XYIntervalSeriesCollection c2 = new XYIntervalSeriesCollection(); assertEquals(c1, c2); // add a series XYIntervalSeries s1 = new XYIntervalSeries("Series"); s1.add(1.0, 1.1, 1.2, 1.3, 1.4, 1.5); c1.addSeries(s1); assertFalse(c1.equals(c2)); XYIntervalSeries s2 = new XYIntervalSeries("Series"); s2.add(1.0, 1.1, 1.2, 1.3, 1.4, 1.5); c2.addSeries(s2); assertTrue(c1.equals(c2)); // add an empty series c1.addSeries(new XYIntervalSeries("Empty Series")); assertFalse(c1.equals(c2)); c2.addSeries(new XYIntervalSeries("Empty Series")); assertTrue(c1.equals(c2));
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/tests/org/jfree/data/time/ohlc/junit/OHLCSeriesCollectionTests.java File path: /jfreechart-1.0.10/tests/org/jfree/data/xy/junit/XYIntervalSeriesCollectionTests.java
Method name: void testEquals() Method name: void testEquals()
Number of AST nodes: 15 Number of AST nodes: 15
1
OHLCSeriesCollection c1 = new OHLCSeriesCollection();
1
XYIntervalSeriesCollection c1 = new XYIntervalSeriesCollection();
2
        OHLCSeriesCollection c2 = new OHLCSeriesCollection();
2
        XYIntervalSeriesCollection c2 = new XYIntervalSeriesCollection();
3
        assertEquals(c1, c2);
3
        assertEquals(c1, c2);
4
        
5
        // add a series
4
        // add a series
6
        OHLCSeries s1 = new OHLCSeries("Series");
5
        XYIntervalSeries s1 = new XYIntervalSeries("Series");
7
        s1.add(new Year(2006), 1.0, 1.1, 1.2, 1.3);
6
        s1.add(1.0, 1.1, 1.2, 1.3, 1.4, 1.5);
8
        c1.addSeries(s1);
7
        c1.addSeries(s1);
9
        assertFalse(c1.equals(c2));
8
        assertFalse(c1.equals(c2));
10
        OHLCSeries s2 = new OHLCSeries("Series");
9
        XYIntervalSeries s2 = new XYIntervalSeries("Series");
11
        s2.add(new Year(2006), 1.0, 1.1, 1.2, 1.3);
10
        s2.add(1.0, 1.1, 1.2, 1.3, 1.4, 1.5);
12
        c2.addSeries(s2);
11
        c2.addSeries(s2);
13
        assertTrue(c1.equals(c2));
12
        assertTrue(c1.equals(c2));
14
        
15
        // add an empty series
13
        // add an empty series
16
        c1.addSeries(new OHLCSeries("Empty Series"));
14
        c1.addSeries(new XYIntervalSeries("Empty Series"));
17
        assertFalse(c1.equals(c2));
15
        assertFalse(c1.equals(c2));
18
        c2.addSeries(new OHLCSeries("Empty Series"));
16
        c2.addSeries(new XYIntervalSeries("Empty Series"));
19
        assertTrue(c1.equals(c2));
17
        assertTrue(c1.equals(c2));
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 comparisons60
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements15
    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
    OHLCSeriesCollection c1 = new OHLCSeriesCollection();
    1
    OHLCSeriesCollection c1 = new OHLCSeriesCollection();
    1
    XYIntervalSeriesCollection c1 = new XYIntervalSeriesCollection();
    Differences
    Expression1Expression2Difference
    org.jfree.data.time.ohlc.OHLCSeriesCollectionorg.jfree.data.xy.XYIntervalSeriesCollectionSUBCLASS_TYPE_MISMATCH
    org.jfree.data.time.ohlc.OHLCSeriesCollectionorg.jfree.data.xy.XYIntervalSeriesCollectionSUBCLASS_TYPE_MISMATCH
    org.jfree.data.time.ohlc.OHLCSeriesCollectionorg.jfree.data.xy.XYIntervalSeriesCollectionSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression new OHLCSeriesCollection() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression new XYIntervalSeriesCollection() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    1
    XYIntervalSeriesCollection c1 = new XYIntervalSeriesCollection();
    2
    OHLCSeriesCollection c2 = new OHLCSeriesCollection();
    2
    OHLCSeriesCollection c2 = new OHLCSeriesCollection();
    2
    XYIntervalSeriesCollection c2 = new XYIntervalSeriesCollection();
    Differences
    Expression1Expression2Difference
    org.jfree.data.time.ohlc.OHLCSeriesCollectionorg.jfree.data.xy.XYIntervalSeriesCollectionSUBCLASS_TYPE_MISMATCH
    org.jfree.data.time.ohlc.OHLCSeriesCollectionorg.jfree.data.xy.XYIntervalSeriesCollectionSUBCLASS_TYPE_MISMATCH
    org.jfree.data.time.ohlc.OHLCSeriesCollectionorg.jfree.data.xy.XYIntervalSeriesCollectionSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression new OHLCSeriesCollection() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression new XYIntervalSeriesCollection() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2
    XYIntervalSeriesCollection c2 = new XYIntervalSeriesCollection();
    3
    assertEquals(c1, c2);
    3
    assertEquals(c1, c2);
    3
    assertEquals(c1, c2);
    Differences
    Expression1Expression2Difference
    org.jfree.data.time.ohlc.OHLCSeriesCollectionorg.jfree.data.xy.XYIntervalSeriesCollectionSUBCLASS_TYPE_MISMATCH
    org.jfree.data.time.ohlc.OHLCSeriesCollectionorg.jfree.data.xy.XYIntervalSeriesCollectionSUBCLASS_TYPE_MISMATCH
    3
    assertEquals(c1, c2);
    4
    OHLCSeries s1 = new OHLCSeries("Series");
    4
    OHLCSeries s1 = new OHLCSeries("Series");
    4
    XYIntervalSeries s1 = new XYIntervalSeries("Series");
    Differences
    Expression1Expression2Difference
    org.jfree.data.time.ohlc.OHLCSeriesorg.jfree.data.xy.XYIntervalSeriesSUBCLASS_TYPE_MISMATCH
    org.jfree.data.time.ohlc.OHLCSeriesorg.jfree.data.xy.XYIntervalSeriesSUBCLASS_TYPE_MISMATCH
    org.jfree.data.time.ohlc.OHLCSeriesorg.jfree.data.xy.XYIntervalSeriesSUBCLASS_TYPE_MISMATCH
    4
    XYIntervalSeries s1 = new XYIntervalSeries("Series");
    5
    s1.add(new Year(2006), 1.0, 1.1, 1.2, 1.3);
    5
    s1.add(new Year(2006), 1.0, 1.1, 1.2, 1.3);
    5
    s1.add(1.0, 1.1, 1.2, 1.3, 1.4, 1.5);
    Differences
    Expression1Expression2Difference
    org.jfree.data.time.ohlc.OHLCSeriesorg.jfree.data.xy.XYIntervalSeriesSUBCLASS_TYPE_MISMATCH
    s1.add(new Year(2006),1.0,1.1,1.2,1.3)s1.add(1.0,1.1,1.2,1.3,1.4,1.5)ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression s1 cannot be unified with expression s1 , because common superclass org.jfree.data.ComparableObjectSeries does not declare member(s) public void add(org.jfree.data.time.RegularTimePeriod, double, double, double, double) , public void add(double, double, double, double, double, double)
    Expression s1.add(new Year(2006),1.0,1.1,1.2,1.3) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression s1.add(1.0,1.1,1.2,1.3,1.4,1.5) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression s1.add(new Year(2006),1.0,1.1,1.2,1.3) is a void method call, and thus it cannot be parameterized
    Expression s1.add(1.0,1.1,1.2,1.3,1.4,1.5) is a void method call, and thus it cannot be parameterized
    5
    s1.add(1.0, 1.1, 1.2, 1.3, 1.4, 1.5);
    6
    c1.addSeries(s1);
    6
    c1.addSeries(s1);
    6
    c1.addSeries(s1);
    Differences
    Expression1Expression2Difference
    org.jfree.data.time.ohlc.OHLCSeriesorg.jfree.data.xy.XYIntervalSeriesSUBCLASS_TYPE_MISMATCH
    org.jfree.data.time.ohlc.OHLCSeriesCollectionorg.jfree.data.xy.XYIntervalSeriesCollectionSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression s1 cannot be unified with expression s1 , because common superclass type org.jfree.data.ComparableObjectSeries cannot be passed as an argument to public void addSeries(org.jfree.data.time.ohlc.OHLCSeries)
    Expression c1 cannot be unified with expression c1 , because common superclass org.jfree.data.xy.AbstractXYDataset does not declare member(s) public void addSeries(org.jfree.data.time.ohlc.OHLCSeries) , public void addSeries(org.jfree.data.xy.XYIntervalSeries)
    6
    c1.addSeries(s1);
    7
    assertFalse(c1.equals(c2));
    7
    assertFalse(c1.equals(c2));
    7
    assertFalse(c1.equals(c2));
    Differences
    Expression1Expression2Difference
    org.jfree.data.time.ohlc.OHLCSeriesCollectionorg.jfree.data.xy.XYIntervalSeriesCollectionSUBCLASS_TYPE_MISMATCH
    org.jfree.data.time.ohlc.OHLCSeriesCollectionorg.jfree.data.xy.XYIntervalSeriesCollectionSUBCLASS_TYPE_MISMATCH
    7
    assertFalse(c1.equals(c2));
    8
    OHLCSeries s2 = new OHLCSeries("Series");
    8
    OHLCSeries s2 = new OHLCSeries("Series");
    8
    XYIntervalSeries s2 = new XYIntervalSeries("Series");
    Differences
    Expression1Expression2Difference
    org.jfree.data.time.ohlc.OHLCSeriesorg.jfree.data.xy.XYIntervalSeriesSUBCLASS_TYPE_MISMATCH
    org.jfree.data.time.ohlc.OHLCSeriesorg.jfree.data.xy.XYIntervalSeriesSUBCLASS_TYPE_MISMATCH
    org.jfree.data.time.ohlc.OHLCSeriesorg.jfree.data.xy.XYIntervalSeriesSUBCLASS_TYPE_MISMATCH
    8
    XYIntervalSeries s2 = new XYIntervalSeries("Series");
    9
    s2.add(new Year(2006), 1.0, 1.1, 1.2, 1.3);
    9
    s2.add(new Year(2006), 1.0, 1.1, 1.2, 1.3);
    9
    s2.add(1.0, 1.1, 1.2, 1.3, 1.4, 1.5);
    Differences
    Expression1Expression2Difference
    org.jfree.data.time.ohlc.OHLCSeriesorg.jfree.data.xy.XYIntervalSeriesSUBCLASS_TYPE_MISMATCH
    s2.add(new Year(2006),1.0,1.1,1.2,1.3)s2.add(1.0,1.1,1.2,1.3,1.4,1.5)ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression s2 cannot be unified with expression s2 , because common superclass org.jfree.data.ComparableObjectSeries does not declare member(s) public void add(org.jfree.data.time.RegularTimePeriod, double, double, double, double) , public void add(double, double, double, double, double, double)
    Expression s2.add(new Year(2006),1.0,1.1,1.2,1.3) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression s2.add(1.0,1.1,1.2,1.3,1.4,1.5) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression s2.add(new Year(2006),1.0,1.1,1.2,1.3) is a void method call, and thus it cannot be parameterized
    Expression s2.add(1.0,1.1,1.2,1.3,1.4,1.5) is a void method call, and thus it cannot be parameterized
    9
    s2.add(1.0, 1.1, 1.2, 1.3, 1.4, 1.5);
    10
    c2.addSeries(s2);
    10
    c2.addSeries(s2);
    10
    c2.addSeries(s2);
    Differences
    Expression1Expression2Difference
    org.jfree.data.time.ohlc.OHLCSeriesorg.jfree.data.xy.XYIntervalSeriesSUBCLASS_TYPE_MISMATCH
    org.jfree.data.time.ohlc.OHLCSeriesCollectionorg.jfree.data.xy.XYIntervalSeriesCollectionSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression s2 cannot be unified with expression s2 , because common superclass type org.jfree.data.ComparableObjectSeries cannot be passed as an argument to public void addSeries(org.jfree.data.time.ohlc.OHLCSeries)
    Expression c2 cannot be unified with expression c2 , because common superclass org.jfree.data.xy.AbstractXYDataset does not declare member(s) public void addSeries(org.jfree.data.time.ohlc.OHLCSeries) , public void addSeries(org.jfree.data.xy.XYIntervalSeries)
    10
    c2.addSeries(s2);
    11
    assertTrue(c1.equals(c2));
    11
    assertTrue(c1.equals(c2));
    11
    assertTrue(c1.equals(c2));
    Differences
    Expression1Expression2Difference
    org.jfree.data.time.ohlc.OHLCSeriesCollectionorg.jfree.data.xy.XYIntervalSeriesCollectionSUBCLASS_TYPE_MISMATCH
    org.jfree.data.time.ohlc.OHLCSeriesCollectionorg.jfree.data.xy.XYIntervalSeriesCollectionSUBCLASS_TYPE_MISMATCH
    11
    assertTrue(c1.equals(c2));
    12
    c1.addSeries(new OHLCSeries("Empty Series"));
    12
    c1.addSeries(new OHLCSeries("Empty Series"));
    12
    c1.addSeries(new XYIntervalSeries("Empty Series"));
    Differences
    Expression1Expression2Difference
    org.jfree.data.time.ohlc.OHLCSeriesorg.jfree.data.xy.XYIntervalSeriesSUBCLASS_TYPE_MISMATCH
    org.jfree.data.time.ohlc.OHLCSeriesCollectionorg.jfree.data.xy.XYIntervalSeriesCollectionSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression new OHLCSeries("Empty Series") cannot be unified with expression new XYIntervalSeries("Empty Series") , because common superclass type org.jfree.data.ComparableObjectSeries cannot be passed as an argument to public void addSeries(org.jfree.data.time.ohlc.OHLCSeries)
    Expression c1 cannot be unified with expression c1 , because common superclass org.jfree.data.xy.AbstractXYDataset does not declare member(s) public void addSeries(org.jfree.data.time.ohlc.OHLCSeries) , public void addSeries(org.jfree.data.xy.XYIntervalSeries)
    12
    c1.addSeries(new XYIntervalSeries("Empty Series"));
    13
    assertFalse(c1.equals(c2));
    13
    assertFalse(c1.equals(c2));
    13
    assertFalse(c1.equals(c2));
    Differences
    Expression1Expression2Difference
    org.jfree.data.time.ohlc.OHLCSeriesCollectionorg.jfree.data.xy.XYIntervalSeriesCollectionSUBCLASS_TYPE_MISMATCH
    org.jfree.data.time.ohlc.OHLCSeriesCollectionorg.jfree.data.xy.XYIntervalSeriesCollectionSUBCLASS_TYPE_MISMATCH
    13
    assertFalse(c1.equals(c2));
    14
    c2.addSeries(new OHLCSeries("Empty Series"));
    14
    c2.addSeries(new OHLCSeries("Empty Series"));
    14
    c2.addSeries(new XYIntervalSeries("Empty Series"));
    Differences
    Expression1Expression2Difference
    org.jfree.data.time.ohlc.OHLCSeriesorg.jfree.data.xy.XYIntervalSeriesSUBCLASS_TYPE_MISMATCH
    org.jfree.data.time.ohlc.OHLCSeriesCollectionorg.jfree.data.xy.XYIntervalSeriesCollectionSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression new OHLCSeries("Empty Series") cannot be unified with expression new XYIntervalSeries("Empty Series") , because common superclass type org.jfree.data.ComparableObjectSeries cannot be passed as an argument to public void addSeries(org.jfree.data.time.ohlc.OHLCSeries)
    Expression c2 cannot be unified with expression c2 , because common superclass org.jfree.data.xy.AbstractXYDataset does not declare member(s) public void addSeries(org.jfree.data.time.ohlc.OHLCSeries) , public void addSeries(org.jfree.data.xy.XYIntervalSeries)
    14
    c2.addSeries(new XYIntervalSeries("Empty Series"));
    15
    assertTrue(c1.equals(c2));
    15
    assertTrue(c1.equals(c2));
    15
    assertTrue(c1.equals(c2));
    Differences
    Expression1Expression2Difference
    org.jfree.data.time.ohlc.OHLCSeriesCollectionorg.jfree.data.xy.XYIntervalSeriesCollectionSUBCLASS_TYPE_MISMATCH
    org.jfree.data.time.ohlc.OHLCSeriesCollectionorg.jfree.data.xy.XYIntervalSeriesCollectionSUBCLASS_TYPE_MISMATCH
    15
    assertTrue(c1.equals(c2));
    Precondition Violations (22)
    Row Violation
    1Expression new OHLCSeriesCollection() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression new XYIntervalSeriesCollection() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression new OHLCSeriesCollection() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression new XYIntervalSeriesCollection() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression s1 cannot be unified with expression s1 , because common superclass org.jfree.data.ComparableObjectSeries does not declare member(s) public void add(org.jfree.data.time.RegularTimePeriod, double, double, double, double) , public void add(double, double, double, double, double, double)
    6Expression s1.add(new Year(2006),1.0,1.1,1.2,1.3) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression s1.add(1.0,1.1,1.2,1.3,1.4,1.5) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Expression s1.add(new Year(2006),1.0,1.1,1.2,1.3) is a void method call, and thus it cannot be parameterized
    9Expression s1.add(1.0,1.1,1.2,1.3,1.4,1.5) is a void method call, and thus it cannot be parameterized
    10Expression s1 cannot be unified with expression s1 , because common superclass type org.jfree.data.ComparableObjectSeries cannot be passed as an argument to public void addSeries(org.jfree.data.time.ohlc.OHLCSeries)
    11Expression c1 cannot be unified with expression c1 , because common superclass org.jfree.data.xy.AbstractXYDataset does not declare member(s) public void addSeries(org.jfree.data.time.ohlc.OHLCSeries) , public void addSeries(org.jfree.data.xy.XYIntervalSeries)
    12Expression s2 cannot be unified with expression s2 , because common superclass org.jfree.data.ComparableObjectSeries does not declare member(s) public void add(org.jfree.data.time.RegularTimePeriod, double, double, double, double) , public void add(double, double, double, double, double, double)
    13Expression s2.add(new Year(2006),1.0,1.1,1.2,1.3) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    14Expression s2.add(1.0,1.1,1.2,1.3,1.4,1.5) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    15Expression s2.add(new Year(2006),1.0,1.1,1.2,1.3) is a void method call, and thus it cannot be parameterized
    16Expression s2.add(1.0,1.1,1.2,1.3,1.4,1.5) is a void method call, and thus it cannot be parameterized
    17Expression s2 cannot be unified with expression s2 , because common superclass type org.jfree.data.ComparableObjectSeries cannot be passed as an argument to public void addSeries(org.jfree.data.time.ohlc.OHLCSeries)
    18Expression c2 cannot be unified with expression c2 , because common superclass org.jfree.data.xy.AbstractXYDataset does not declare member(s) public void addSeries(org.jfree.data.time.ohlc.OHLCSeries) , public void addSeries(org.jfree.data.xy.XYIntervalSeries)
    19Expression new OHLCSeries("Empty Series") cannot be unified with expression new XYIntervalSeries("Empty Series") , because common superclass type org.jfree.data.ComparableObjectSeries cannot be passed as an argument to public void addSeries(org.jfree.data.time.ohlc.OHLCSeries)
    20Expression c1 cannot be unified with expression c1 , because common superclass org.jfree.data.xy.AbstractXYDataset does not declare member(s) public void addSeries(org.jfree.data.time.ohlc.OHLCSeries) , public void addSeries(org.jfree.data.xy.XYIntervalSeries)
    21Expression new OHLCSeries("Empty Series") cannot be unified with expression new XYIntervalSeries("Empty Series") , because common superclass type org.jfree.data.ComparableObjectSeries cannot be passed as an argument to public void addSeries(org.jfree.data.time.ohlc.OHLCSeries)
    22Expression c2 cannot be unified with expression c2 , because common superclass org.jfree.data.xy.AbstractXYDataset does not declare member(s) public void addSeries(org.jfree.data.time.ohlc.OHLCSeries) , public void addSeries(org.jfree.data.xy.XYIntervalSeries)