VectorSeries s1 = new VectorSeries("S1"); assertEquals(Integer.MAX_VALUE, s1.getMaximumItemCount()); s1.setMaximumItemCount(2); assertEquals(2, s1.getMaximumItemCount()); s1.add(1.0, 1.1, 1.1, 1.1); s1.add(2.0, 2.2, 2.2, 2.2); s1.add(3.0, 3.3, 3.3, 3.3); assertEquals(2.0, s1.getXValue(0), EPSILON); assertEquals(3.0, s1.getXValue(1), EPSILON);
XIntervalSeries s1 = new XIntervalSeries("S1"); assertEquals(Integer.MAX_VALUE, s1.getMaximumItemCount()); s1.setMaximumItemCount(2); assertEquals(2, s1.getMaximumItemCount()); s1.add(1.0, 1.1, 1.1, 1.1); s1.add(2.0, 2.2, 2.2, 2.2); s1.add(3.0, 3.3, 3.3, 3.3); assertEquals(2.0, s1.getX(0).doubleValue(), EPSILON); assertEquals(3.0, s1.getX(1).doubleValue(), EPSILON);
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/tests/org/jfree/data/xy/junit/VectorSeriesTests.java File path: /jfreechart-1.0.10/tests/org/jfree/data/xy/junit/XIntervalSeriesTests.java
Method name: void testSetMaximumItemCount() Method name: void testSetMaximumItemCount()
Number of AST nodes: 9 Number of AST nodes: 9
1
VectorSeries s1 = new VectorSeries("S1");
1
XIntervalSeries s1 = new XIntervalSeries("S1");
2
        assertEquals(Integer.MAX_VALUE, s1.getMaximumItemCount());
2
        assertEquals(Integer.MAX_VALUE, s1.getMaximumItemCount());
3
        s1.setMaximumItemCount(2);
3
        s1.setMaximumItemCount(2);
4
        assertEquals(2, s1.getMaximumItemCount());
4
        assertEquals(2, s1.getMaximumItemCount());
5
        s1.add(1.0, 1.1, 1.1, 1.1);
5
        s1.add(1.0, 1.1, 1.1, 1.1);
6
        s1.add(2.0, 2.2, 2.2, 2.2);
6
        s1.add(2.0, 2.2, 2.2, 2.2);
7
        s1.add(3.0, 3.3, 3.3, 3.3);
7
        s1.add(3.0, 3.3, 3.3, 3.3);
8
        assertEquals(2.0, s1.getXValue(0), EPSILON);
8
        assertEquals(2.0, s1.getX(0).doubleValue(), EPSILON);
9
        assertEquals(3.0, s1.getXValue(1), EPSILON);
9
        assertEquals(3.0, s1.getX(1).doubleValue(), EPSILON);
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 comparisons41
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements7
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    VectorSeries s1 = new VectorSeries("S1");
    1
    VectorSeries s1 = new VectorSeries("S1");
    1
    XIntervalSeries s1 = new XIntervalSeries("S1");
    Differences
    Expression1Expression2Difference
    org.jfree.data.xy.VectorSeriesorg.jfree.data.xy.XIntervalSeriesSUBCLASS_TYPE_MISMATCH
    org.jfree.data.xy.VectorSeriesorg.jfree.data.xy.XIntervalSeriesSUBCLASS_TYPE_MISMATCH
    org.jfree.data.xy.VectorSeriesorg.jfree.data.xy.XIntervalSeriesSUBCLASS_TYPE_MISMATCH
    1
    XIntervalSeries s1 = new XIntervalSeries("S1");
    2
    assertEquals(Integer.MAX_VALUE, s1.getMaximumItemCount());
    2
    assertEquals(Integer.MAX_VALUE, s1.getMaximumItemCount());
    2
    assertEquals(Integer.MAX_VALUE, s1.getMaximumItemCount());
    Differences
    Expression1Expression2Difference
    org.jfree.data.xy.VectorSeriesorg.jfree.data.xy.XIntervalSeriesSUBCLASS_TYPE_MISMATCH
    2
    assertEquals(Integer.MAX_VALUE, s1.getMaximumItemCount());
    3
    s1.setMaximumItemCount(2);
    3
    s1.setMaximumItemCount(2);
    3
    s1.setMaximumItemCount(2);
    Differences
    Expression1Expression2Difference
    org.jfree.data.xy.VectorSeriesorg.jfree.data.xy.XIntervalSeriesSUBCLASS_TYPE_MISMATCH
    3
    s1.setMaximumItemCount(2);
    4
    assertEquals(2, s1.getMaximumItemCount());
    4
    assertEquals(2, s1.getMaximumItemCount());
    4
    assertEquals(2, s1.getMaximumItemCount());
    Differences
    Expression1Expression2Difference
    org.jfree.data.xy.VectorSeriesorg.jfree.data.xy.XIntervalSeriesSUBCLASS_TYPE_MISMATCH
    4
    assertEquals(2, s1.getMaximumItemCount());
    5
    s1.add(1.0, 1.1, 1.1, 1.1);
    5
    s1.add(1.0, 1.1, 1.1, 1.1);
    5
    s1.add(1.0, 1.1, 1.1, 1.1);
    Differences
    Expression1Expression2Difference
    org.jfree.data.xy.VectorSeriesorg.jfree.data.xy.XIntervalSeriesSUBCLASS_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.1, 1.1);
    6
    s1.add(2.0, 2.2, 2.2, 2.2);
    6
    s1.add(2.0, 2.2, 2.2, 2.2);
    6
    s1.add(2.0, 2.2, 2.2, 2.2);
    Differences
    Expression1Expression2Difference
    org.jfree.data.xy.VectorSeriesorg.jfree.data.xy.XIntervalSeriesSUBCLASS_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)
    6
    s1.add(2.0, 2.2, 2.2, 2.2);
    7
    s1.add(3.0, 3.3, 3.3, 3.3);
    7
    s1.add(3.0, 3.3, 3.3, 3.3);
    7
    s1.add(3.0, 3.3, 3.3, 3.3);
    Differences
    Expression1Expression2Difference
    org.jfree.data.xy.VectorSeriesorg.jfree.data.xy.XIntervalSeriesSUBCLASS_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)
    7
    s1.add(3.0, 3.3, 3.3, 3.3);
                                                                                                                
    8
    assertEquals(2.0, s1.getX(0).doubleValue(), EPSILON);
    Preondition Violations
    Unmatched statement assertEquals(2.0,s1.getX(0).doubleValue(),EPSILON); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    8
    assertEquals(2.0, s1.getX(0).doubleValue(), EPSILON);
    8
    assertEquals(2.0, s1.getXValue(0), EPSILON);
    8
    assertEquals(2.0, s1.getXValue(0), EPSILON);
    Preondition Violations
    Unmatched statement assertEquals(2.0,s1.getXValue(0),EPSILON); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                              
                                                                                                                
    9
    assertEquals(3.0, s1.getX(1).doubleValue(), EPSILON);
    Preondition Violations
    Unmatched statement assertEquals(3.0,s1.getX(1).doubleValue(),EPSILON); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    9
    assertEquals(3.0, s1.getX(1).doubleValue(), EPSILON);
    9
    assertEquals(3.0, s1.getXValue(1), EPSILON);
    9
    assertEquals(3.0, s1.getXValue(1), EPSILON);
    Preondition Violations
    Unmatched statement assertEquals(3.0,s1.getXValue(1),EPSILON); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                              
    Precondition Violations (8)
    Row Violation
    1Expression 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)
    2Expression 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)
    3Expression 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)
    4Unmatched statement assertEquals(2.0,s1.getX(0).doubleValue(),EPSILON); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    5Unmatched statement assertEquals(2.0,s1.getXValue(0),EPSILON); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    6Unmatched statement assertEquals(3.0,s1.getX(1).doubleValue(),EPSILON); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    7Unmatched statement assertEquals(3.0,s1.getXValue(1),EPSILON); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    8Clone fragment #1 returns variable s1 with type org.jfree.data.xy.VectorSeries , while Clone fragment #2 returns variable s1 with type org.jfree.data.xy.XIntervalSeries