XIntervalSeriesCollection c1 = new XIntervalSeriesCollection(); XIntervalSeriesCollection c2 = new XIntervalSeriesCollection(); assertEquals(c1, c2); // add a series XIntervalSeries s1 = new XIntervalSeries("Series"); s1.add(1.0, 1.1, 1.2, 1.3); c1.addSeries(s1); assertFalse(c1.equals(c2)); XIntervalSeries s2 = new XIntervalSeries("Series"); s2.add(1.0, 1.1, 1.2, 1.3); c2.addSeries(s2); assertTrue(c1.equals(c2)); // add an empty series c1.addSeries(new XIntervalSeries("Empty Series")); assertFalse(c1.equals(c2)); c2.addSeries(new XIntervalSeries("Empty Series")); assertTrue(c1.equals(c2));
YIntervalSeriesCollection c1 = new YIntervalSeriesCollection(); YIntervalSeriesCollection c2 = new YIntervalSeriesCollection(); assertEquals(c1, c2); // add a series YIntervalSeries s1 = new YIntervalSeries("Series"); s1.add(1.0, 1.1, 1.2, 1.3); c1.addSeries(s1); assertFalse(c1.equals(c2)); YIntervalSeries s2 = new YIntervalSeries("Series"); s2.add(1.0, 1.1, 1.2, 1.3); c2.addSeries(s2); assertTrue(c1.equals(c2)); // add an empty series c1.addSeries(new YIntervalSeries("Empty Series")); assertFalse(c1.equals(c2)); c2.addSeries(new YIntervalSeries("Empty Series")); assertTrue(c1.equals(c2));
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/tests/org/jfree/data/xy/junit/XIntervalSeriesCollectionTests.java File path: /jfreechart-1.0.10/tests/org/jfree/data/xy/junit/YIntervalSeriesCollectionTests.java
Method name: void testEquals() Method name: void testEquals()
Number of AST nodes: 15 Number of AST nodes: 15
1
XIntervalSeriesCollection c1 = new XIntervalSeriesCollection();
1
YIntervalSeriesCollection c1 = new YIntervalSeriesCollection();
2
        XIntervalSeriesCollection c2 = new XIntervalSeriesCollection();
2
        YIntervalSeriesCollection c2 = new YIntervalSeriesCollection();
3
        assertEquals(c1, c2);
3
        assertEquals(c1, c2);
4
        // add a series
4
        // add a series
5
        XIntervalSeries s1 = new XIntervalSeries("Series");
5
        YIntervalSeries s1 = new YIntervalSeries("Series");
6
        s1.add(1.0, 1.1, 1.2, 1.3);
6
        s1.add(1.0, 1.1, 1.2, 1.3);
7
        c1.addSeries(s1);
7
        c1.addSeries(s1);
8
        assertFalse(c1.equals(c2));
8
        assertFalse(c1.equals(c2));
9
        XIntervalSeries s2 = new XIntervalSeries("Series");
9
        YIntervalSeries s2 = new YIntervalSeries("Series");
10
        s2.add(1.0, 1.1, 1.2, 1.3);
10
        s2.add(1.0, 1.1, 1.2, 1.3);
11
        c2.addSeries(s2);
11
        c2.addSeries(s2);
12
        assertTrue(c1.equals(c2));
12
        assertTrue(c1.equals(c2));
13
        // add an empty series
13
        // add an empty series
14
        c1.addSeries(new XIntervalSeries("Empty Series"));
14
        c1.addSeries(new YIntervalSeries("Empty Series"));
15
        assertFalse(c1.equals(c2));
15
        assertFalse(c1.equals(c2));
16
        c2.addSeries(new XIntervalSeries("Empty Series"));
16
        c2.addSeries(new YIntervalSeries("Empty Series"));
17
        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
    XIntervalSeriesCollection c1 = new XIntervalSeriesCollection();
    1
    XIntervalSeriesCollection c1 = new XIntervalSeriesCollection();
    1
    YIntervalSeriesCollection c1 = new YIntervalSeriesCollection();
    Differences
    Expression1Expression2Difference
    org.jfree.data.xy.XIntervalSeriesCollectionorg.jfree.data.xy.YIntervalSeriesCollectionSUBCLASS_TYPE_MISMATCH
    org.jfree.data.xy.XIntervalSeriesCollectionorg.jfree.data.xy.YIntervalSeriesCollectionSUBCLASS_TYPE_MISMATCH
    org.jfree.data.xy.XIntervalSeriesCollectionorg.jfree.data.xy.YIntervalSeriesCollectionSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression new XIntervalSeriesCollection() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression new YIntervalSeriesCollection() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    1
    YIntervalSeriesCollection c1 = new YIntervalSeriesCollection();
    2
    XIntervalSeriesCollection c2 = new XIntervalSeriesCollection();
    2
    XIntervalSeriesCollection c2 = new XIntervalSeriesCollection();
    2
    YIntervalSeriesCollection c2 = new YIntervalSeriesCollection();
    Differences
    Expression1Expression2Difference
    org.jfree.data.xy.XIntervalSeriesCollectionorg.jfree.data.xy.YIntervalSeriesCollectionSUBCLASS_TYPE_MISMATCH
    org.jfree.data.xy.XIntervalSeriesCollectionorg.jfree.data.xy.YIntervalSeriesCollectionSUBCLASS_TYPE_MISMATCH
    org.jfree.data.xy.XIntervalSeriesCollectionorg.jfree.data.xy.YIntervalSeriesCollectionSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression new XIntervalSeriesCollection() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression new YIntervalSeriesCollection() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2
    YIntervalSeriesCollection c2 = new YIntervalSeriesCollection();
    3
    assertEquals(c1, c2);
    3
    assertEquals(c1, c2);
    3
    assertEquals(c1, c2);
    Differences
    Expression1Expression2Difference
    org.jfree.data.xy.XIntervalSeriesCollectionorg.jfree.data.xy.YIntervalSeriesCollectionSUBCLASS_TYPE_MISMATCH
    org.jfree.data.xy.XIntervalSeriesCollectionorg.jfree.data.xy.YIntervalSeriesCollectionSUBCLASS_TYPE_MISMATCH
    3
    assertEquals(c1, c2);
    4
    XIntervalSeries s1 = new XIntervalSeries("Series");
    4
    XIntervalSeries s1 = new XIntervalSeries("Series");
    4
    YIntervalSeries s1 = new YIntervalSeries("Series");
    Differences
    Expression1Expression2Difference
    org.jfree.data.xy.XIntervalSeriesorg.jfree.data.xy.YIntervalSeriesSUBCLASS_TYPE_MISMATCH
    org.jfree.data.xy.XIntervalSeriesorg.jfree.data.xy.YIntervalSeriesSUBCLASS_TYPE_MISMATCH
    org.jfree.data.xy.XIntervalSeriesorg.jfree.data.xy.YIntervalSeriesSUBCLASS_TYPE_MISMATCH
    4
    YIntervalSeries s1 = new YIntervalSeries("Series");
    5
    s1.add(1.0, 1.1, 1.2, 1.3);
    5
    s1.add(1.0, 1.1, 1.2, 1.3);
    5
    s1.add(1.0, 1.1, 1.2, 1.3);
    Differences
    Expression1Expression2Difference
    org.jfree.data.xy.XIntervalSeriesorg.jfree.data.xy.YIntervalSeriesSUBCLASS_TYPE_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(double, double, double, double)
    5
    s1.add(1.0, 1.1, 1.2, 1.3);
    6
    c1.addSeries(s1);
    6
    c1.addSeries(s1);
    6
    c1.addSeries(s1);
    Differences
    Expression1Expression2Difference
    org.jfree.data.xy.XIntervalSeriesorg.jfree.data.xy.YIntervalSeriesSUBCLASS_TYPE_MISMATCH
    org.jfree.data.xy.XIntervalSeriesCollectionorg.jfree.data.xy.YIntervalSeriesCollectionSUBCLASS_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.xy.XIntervalSeries)
    Expression c1 cannot be unified with expression c1 , because common superclass org.jfree.data.xy.AbstractIntervalXYDataset does not declare member(s) public void addSeries(org.jfree.data.xy.XIntervalSeries) , public void addSeries(org.jfree.data.xy.YIntervalSeries)
    6
    c1.addSeries(s1);
    7
    assertFalse(c1.equals(c2));
    7
    assertFalse(c1.equals(c2));
    7
    assertFalse(c1.equals(c2));
    Differences
    Expression1Expression2Difference
    org.jfree.data.xy.XIntervalSeriesCollectionorg.jfree.data.xy.YIntervalSeriesCollectionSUBCLASS_TYPE_MISMATCH
    org.jfree.data.xy.XIntervalSeriesCollectionorg.jfree.data.xy.YIntervalSeriesCollectionSUBCLASS_TYPE_MISMATCH
    7
    assertFalse(c1.equals(c2));
    8
    XIntervalSeries s2 = new XIntervalSeries("Series");
    8
    XIntervalSeries s2 = new XIntervalSeries("Series");
    8
    YIntervalSeries s2 = new YIntervalSeries("Series");
    Differences
    Expression1Expression2Difference
    org.jfree.data.xy.XIntervalSeriesorg.jfree.data.xy.YIntervalSeriesSUBCLASS_TYPE_MISMATCH
    org.jfree.data.xy.XIntervalSeriesorg.jfree.data.xy.YIntervalSeriesSUBCLASS_TYPE_MISMATCH
    org.jfree.data.xy.XIntervalSeriesorg.jfree.data.xy.YIntervalSeriesSUBCLASS_TYPE_MISMATCH
    8
    YIntervalSeries s2 = new YIntervalSeries("Series");
    9
    s2.add(1.0, 1.1, 1.2, 1.3);
    9
    s2.add(1.0, 1.1, 1.2, 1.3);
    9
    s2.add(1.0, 1.1, 1.2, 1.3);
    Differences
    Expression1Expression2Difference
    org.jfree.data.xy.XIntervalSeriesorg.jfree.data.xy.YIntervalSeriesSUBCLASS_TYPE_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(double, double, double, double)
    9
    s2.add(1.0, 1.1, 1.2, 1.3);
    10
    c2.addSeries(s2);
    10
    c2.addSeries(s2);
    10
    c2.addSeries(s2);
    Differences
    Expression1Expression2Difference
    org.jfree.data.xy.XIntervalSeriesorg.jfree.data.xy.YIntervalSeriesSUBCLASS_TYPE_MISMATCH
    org.jfree.data.xy.XIntervalSeriesCollectionorg.jfree.data.xy.YIntervalSeriesCollectionSUBCLASS_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.xy.XIntervalSeries)
    Expression c2 cannot be unified with expression c2 , because common superclass org.jfree.data.xy.AbstractIntervalXYDataset does not declare member(s) public void addSeries(org.jfree.data.xy.XIntervalSeries) , public void addSeries(org.jfree.data.xy.YIntervalSeries)
    10
    c2.addSeries(s2);
    11
    assertTrue(c1.equals(c2));
    11
    assertTrue(c1.equals(c2));
    11
    assertTrue(c1.equals(c2));
    Differences
    Expression1Expression2Difference
    org.jfree.data.xy.XIntervalSeriesCollectionorg.jfree.data.xy.YIntervalSeriesCollectionSUBCLASS_TYPE_MISMATCH
    org.jfree.data.xy.XIntervalSeriesCollectionorg.jfree.data.xy.YIntervalSeriesCollectionSUBCLASS_TYPE_MISMATCH
    11
    assertTrue(c1.equals(c2));
    12
    c1.addSeries(new XIntervalSeries("Empty Series"));
    12
    c1.addSeries(new XIntervalSeries("Empty Series"));
    12
    c1.addSeries(new YIntervalSeries("Empty Series"));
    Differences
    Expression1Expression2Difference
    org.jfree.data.xy.XIntervalSeriesorg.jfree.data.xy.YIntervalSeriesSUBCLASS_TYPE_MISMATCH
    org.jfree.data.xy.XIntervalSeriesCollectionorg.jfree.data.xy.YIntervalSeriesCollectionSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression new XIntervalSeries("Empty Series") cannot be unified with expression new YIntervalSeries("Empty Series") , because common superclass type org.jfree.data.ComparableObjectSeries cannot be passed as an argument to public void addSeries(org.jfree.data.xy.XIntervalSeries)
    Expression c1 cannot be unified with expression c1 , because common superclass org.jfree.data.xy.AbstractIntervalXYDataset does not declare member(s) public void addSeries(org.jfree.data.xy.XIntervalSeries) , public void addSeries(org.jfree.data.xy.YIntervalSeries)
    12
    c1.addSeries(new YIntervalSeries("Empty Series"));
    13
    assertFalse(c1.equals(c2));
    13
    assertFalse(c1.equals(c2));
    13
    assertFalse(c1.equals(c2));
    Differences
    Expression1Expression2Difference
    org.jfree.data.xy.XIntervalSeriesCollectionorg.jfree.data.xy.YIntervalSeriesCollectionSUBCLASS_TYPE_MISMATCH
    org.jfree.data.xy.XIntervalSeriesCollectionorg.jfree.data.xy.YIntervalSeriesCollectionSUBCLASS_TYPE_MISMATCH
    13
    assertFalse(c1.equals(c2));
    14
    c2.addSeries(new XIntervalSeries("Empty Series"));
    14
    c2.addSeries(new XIntervalSeries("Empty Series"));
    14
    c2.addSeries(new YIntervalSeries("Empty Series"));
    Differences
    Expression1Expression2Difference
    org.jfree.data.xy.XIntervalSeriesorg.jfree.data.xy.YIntervalSeriesSUBCLASS_TYPE_MISMATCH
    org.jfree.data.xy.XIntervalSeriesCollectionorg.jfree.data.xy.YIntervalSeriesCollectionSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression new XIntervalSeries("Empty Series") cannot be unified with expression new YIntervalSeries("Empty Series") , because common superclass type org.jfree.data.ComparableObjectSeries cannot be passed as an argument to public void addSeries(org.jfree.data.xy.XIntervalSeries)
    Expression c2 cannot be unified with expression c2 , because common superclass org.jfree.data.xy.AbstractIntervalXYDataset does not declare member(s) public void addSeries(org.jfree.data.xy.XIntervalSeries) , public void addSeries(org.jfree.data.xy.YIntervalSeries)
    14
    c2.addSeries(new YIntervalSeries("Empty Series"));
    15
    assertTrue(c1.equals(c2));
    15
    assertTrue(c1.equals(c2));
    15
    assertTrue(c1.equals(c2));
    Differences
    Expression1Expression2Difference
    org.jfree.data.xy.XIntervalSeriesCollectionorg.jfree.data.xy.YIntervalSeriesCollectionSUBCLASS_TYPE_MISMATCH
    org.jfree.data.xy.XIntervalSeriesCollectionorg.jfree.data.xy.YIntervalSeriesCollectionSUBCLASS_TYPE_MISMATCH
    15
    assertTrue(c1.equals(c2));
    Precondition Violations (14)
    Row Violation
    1Expression new XIntervalSeriesCollection() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression new YIntervalSeriesCollection() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression new XIntervalSeriesCollection() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression new YIntervalSeriesCollection() 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(double, double, double, double)
    6Expression 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.xy.XIntervalSeries)
    7Expression c1 cannot be unified with expression c1 , because common superclass org.jfree.data.xy.AbstractIntervalXYDataset does not declare member(s) public void addSeries(org.jfree.data.xy.XIntervalSeries) , public void addSeries(org.jfree.data.xy.YIntervalSeries)
    8Expression s2 cannot be unified with expression s2 , because common superclass org.jfree.data.ComparableObjectSeries does not declare member(s) public void add(double, double, double, double)
    9Expression 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.xy.XIntervalSeries)
    10Expression c2 cannot be unified with expression c2 , because common superclass org.jfree.data.xy.AbstractIntervalXYDataset does not declare member(s) public void addSeries(org.jfree.data.xy.XIntervalSeries) , public void addSeries(org.jfree.data.xy.YIntervalSeries)
    11Expression new XIntervalSeries("Empty Series") cannot be unified with expression new YIntervalSeries("Empty Series") , because common superclass type org.jfree.data.ComparableObjectSeries cannot be passed as an argument to public void addSeries(org.jfree.data.xy.XIntervalSeries)
    12Expression c1 cannot be unified with expression c1 , because common superclass org.jfree.data.xy.AbstractIntervalXYDataset does not declare member(s) public void addSeries(org.jfree.data.xy.XIntervalSeries) , public void addSeries(org.jfree.data.xy.YIntervalSeries)
    13Expression new XIntervalSeries("Empty Series") cannot be unified with expression new YIntervalSeries("Empty Series") , because common superclass type org.jfree.data.ComparableObjectSeries cannot be passed as an argument to public void addSeries(org.jfree.data.xy.XIntervalSeries)
    14Expression c2 cannot be unified with expression c2 , because common superclass org.jfree.data.xy.AbstractIntervalXYDataset does not declare member(s) public void addSeries(org.jfree.data.xy.XIntervalSeries) , public void addSeries(org.jfree.data.xy.YIntervalSeries)