VectorSeries s1 = new VectorSeries("Series 1"); s1.add(1.0, 1.0, 1.0, 2.0); s1.add(3.0, 3.0, 3.0, 3.0); s1.add(2.0, 2.0, 2.0, 2.0); assertEquals(0, s1.indexOf(new XYCoordinate(1.0, 1.0))); assertEquals(1, s1.indexOf(new XYCoordinate(3.0, 3.0))); assertEquals(2, s1.indexOf(new XYCoordinate(2.0, 2.0)));
XYIntervalSeries s1 = new XYIntervalSeries("S1"); s1.add(1.0, 1.1, 1.1, 1.1, 1.1, 1.1); s1.add(2.0, 2.2, 2.2, 2.2, 2.2, 2.2); s1.add(3.0, 3.3, 3.3, 3.3, 2.2, 2.2); s1.setMaximumItemCount(2); 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/XYIntervalSeriesTests.java
Method name: void testIndexOf2() Method name: void testSetMaximumItemCount2()
Number of AST nodes: 7 Number of AST nodes: 7
1
VectorSeries s1 = new VectorSeries("Series 1");
1
XYIntervalSeries s1 = new XYIntervalSeries("S1");
2
        s1.add(1.0, 1.0, 1.0, 2.0);
2
        s1.add(1.0, 1.1, 1.1, 1.1, 1.1, 1.1);
3
        s1.add(3.0, 3.0, 3.0, 3.0);
3
        s1.add(2.0, 2.2, 2.2, 2.2, 2.2, 2.2);
4
        s1.add(2.0, 2.0, 2.0, 2.0);
4
        s1.add(3.0, 3.3, 3.3, 3.3, 2.2, 2.2);
5
        assertEquals(0, s1.indexOf(new XYCoordinate(1.0, 1.0)));        
5
        s1.setMaximumItemCount(2);
6
        assertEquals(1, s1.indexOf(new XYCoordinate(3.0, 3.0)));        
6
        assertEquals(2.0, s1.getX(0).doubleValue(), EPSILON);
7
        assertEquals(2, s1.indexOf(new XYCoordinate(2.0, 2.0)));
7
        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 comparisons29
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements6
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    VectorSeries s1 = new VectorSeries("Series 1");
    1
    VectorSeries s1 = new VectorSeries("Series 1");
    1
    XYIntervalSeries s1 = new XYIntervalSeries("S1");
    Differences
    Expression1Expression2Difference
    org.jfree.data.xy.VectorSeriesorg.jfree.data.xy.XYIntervalSeriesSUBCLASS_TYPE_MISMATCH
    org.jfree.data.xy.VectorSeriesorg.jfree.data.xy.XYIntervalSeriesSUBCLASS_TYPE_MISMATCH
    org.jfree.data.xy.VectorSeriesorg.jfree.data.xy.XYIntervalSeriesSUBCLASS_TYPE_MISMATCH
    "Series 1""S1"LITERAL_VALUE_MISMATCH
    1
    XYIntervalSeries s1 = new XYIntervalSeries("S1");
    2
    s1.add(1.0, 1.0, 1.0, 2.0);
    2
    s1.add(1.0, 1.0, 1.0, 2.0);
    2
    s1.add(1.0, 1.1, 1.1, 1.1, 1.1, 1.1);
    Differences
    Expression1Expression2Difference
    org.jfree.data.xy.VectorSeriesorg.jfree.data.xy.XYIntervalSeriesSUBCLASS_TYPE_MISMATCH
    s1.add(1.0,1.0,1.0,2.0)s1.add(1.0,1.1,1.1,1.1,1.1,1.1)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(double, double, double, double) , public void add(double, double, double, double, double, double)
    Expression s1.add(1.0,1.0,1.0,2.0) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression s1.add(1.0,1.1,1.1,1.1,1.1,1.1) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression s1.add(1.0,1.0,1.0,2.0) is a void method call, and thus it cannot be parameterized
    Expression s1.add(1.0,1.1,1.1,1.1,1.1,1.1) is a void method call, and thus it cannot be parameterized
    2
    s1.add(1.0, 1.1, 1.1, 1.1, 1.1, 1.1);
    3
    s1.add(3.0, 3.0, 3.0, 3.0);
    3
    s1.add(3.0, 3.0, 3.0, 3.0);
    3
    s1.add(2.0, 2.2, 2.2, 2.2, 2.2, 2.2);
    Differences
    Expression1Expression2Difference
    org.jfree.data.xy.VectorSeriesorg.jfree.data.xy.XYIntervalSeriesSUBCLASS_TYPE_MISMATCH
    s1.add(3.0,3.0,3.0,3.0)s1.add(2.0,2.2,2.2,2.2,2.2,2.2)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(double, double, double, double) , public void add(double, double, double, double, double, double)
    Expression s1.add(3.0,3.0,3.0,3.0) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression s1.add(2.0,2.2,2.2,2.2,2.2,2.2) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression s1.add(3.0,3.0,3.0,3.0) is a void method call, and thus it cannot be parameterized
    Expression s1.add(2.0,2.2,2.2,2.2,2.2,2.2) is a void method call, and thus it cannot be parameterized
    3
    s1.add(2.0, 2.2, 2.2, 2.2, 2.2, 2.2);
                                                                          
    4
    s1.add(3.0, 3.3, 3.3, 3.3, 2.2, 2.2);
    Preondition Violations
    Unmatched statement s1.add(3.0,3.3,3.3,3.3,2.2,2.2); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    4
    s1.add(3.0, 3.3, 3.3, 3.3, 2.2, 2.2);
    4
    s1.add(2.0, 2.0, 2.0, 2.0);
    4
    s1.add(2.0, 2.0, 2.0, 2.0);
    5
    s1.setMaximumItemCount(2);
    Differences
    Expression1Expression2Difference
    addsetMaximumItemCountMETHOD_INVOCATION_NAME_MISMATCH
    org.jfree.data.xy.VectorSeriesorg.jfree.data.xy.XYIntervalSeriesSUBCLASS_TYPE_MISMATCH
    s1.add(2.0,2.0,2.0,2.0)s1.setMaximumItemCount(2)ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression s1.add(2.0,2.0,2.0,2.0) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression s1.setMaximumItemCount(2) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression s1.add(2.0,2.0,2.0,2.0) is a void method call, and thus it cannot be parameterized
    Expression s1.setMaximumItemCount(2) is a void method call, and thus it cannot be parameterized
    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)
    Expression s1.add(2.0,2.0,2.0,2.0) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression s1.setMaximumItemCount(2) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression s1.add(2.0,2.0,2.0,2.0) is a void method call, and thus it cannot be parameterized
    Expression s1.setMaximumItemCount(2) is a void method call, and thus it cannot be parameterized
    5
    s1.setMaximumItemCount(2);
    5
    assertEquals(0, s1.indexOf(new XYCoordinate(1.0, 1.0)));
    5
    assertEquals(0, s1.indexOf(new XYCoordinate(1.0, 1.0)));
    Preondition Violations
    Unmatched statement assertEquals(0,s1.indexOf(new XYCoordinate(1.0,1.0))); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                                                      
    6
    assertEquals(1, s1.indexOf(new XYCoordinate(3.0, 3.0)));
    6
    assertEquals(1, s1.indexOf(new XYCoordinate(3.0, 3.0)));
    6
    assertEquals(2.0, s1.getX(0).doubleValue(), EPSILON);
    Differences
    Expression1Expression2Difference
    assertEquals(1,s1.indexOf(new XYCoordinate(3.0,3.0)))assertEquals(2.0,s1.getX(0).doubleValue(),EPSILON)ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression assertEquals(1,s1.indexOf(new XYCoordinate(3.0,3.0))) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression assertEquals(2.0,s1.getX(0).doubleValue(),EPSILON) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression assertEquals(1,s1.indexOf(new XYCoordinate(3.0,3.0))) is a void method call, and thus it cannot be parameterized
    Expression assertEquals(2.0,s1.getX(0).doubleValue(),EPSILON) is a void method call, and thus it cannot be parameterized
    6
    assertEquals(2.0, s1.getX(0).doubleValue(), EPSILON);
    7
    assertEquals(2, s1.indexOf(new XYCoordinate(2.0, 2.0)));
    7
    assertEquals(2, s1.indexOf(new XYCoordinate(2.0, 2.0)));
    7
    assertEquals(3.0, s1.getX(1).doubleValue(), EPSILON);
    Differences
    Expression1Expression2Difference
    assertEquals(2,s1.indexOf(new XYCoordinate(2.0,2.0)))assertEquals(3.0,s1.getX(1).doubleValue(),EPSILON)ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression assertEquals(2,s1.indexOf(new XYCoordinate(2.0,2.0))) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression assertEquals(3.0,s1.getX(1).doubleValue(),EPSILON) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression assertEquals(2,s1.indexOf(new XYCoordinate(2.0,2.0))) is a void method call, and thus it cannot be parameterized
    Expression assertEquals(3.0,s1.getX(1).doubleValue(),EPSILON) is a void method call, and thus it cannot be parameterized
    7
    assertEquals(3.0, s1.getX(1).doubleValue(), EPSILON);
    Precondition Violations (30)
    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) , public void add(double, double, double, double, double, double)
    2Expression s1.add(1.0,1.0,1.0,2.0) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression s1.add(1.0,1.1,1.1,1.1,1.1,1.1) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression s1.add(1.0,1.0,1.0,2.0) is a void method call, and thus it cannot be parameterized
    5Expression s1.add(1.0,1.1,1.1,1.1,1.1,1.1) is a void method call, and thus it cannot be parameterized
    6Expression 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) , public void add(double, double, double, double, double, double)
    7Expression s1.add(3.0,3.0,3.0,3.0) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Expression s1.add(2.0,2.2,2.2,2.2,2.2,2.2) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    9Expression s1.add(3.0,3.0,3.0,3.0) is a void method call, and thus it cannot be parameterized
    10Expression s1.add(2.0,2.2,2.2,2.2,2.2,2.2) is a void method call, and thus it cannot be parameterized
    11Unmatched statement s1.add(3.0,3.3,3.3,3.3,2.2,2.2); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    12Expression s1.add(2.0,2.0,2.0,2.0) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    13Expression s1.setMaximumItemCount(2) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    14Expression s1.add(2.0,2.0,2.0,2.0) is a void method call, and thus it cannot be parameterized
    15Expression s1.setMaximumItemCount(2) is a void method call, and thus it cannot be parameterized
    16Expression 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)
    17Expression s1.add(2.0,2.0,2.0,2.0) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    18Expression s1.setMaximumItemCount(2) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    19Expression s1.add(2.0,2.0,2.0,2.0) is a void method call, and thus it cannot be parameterized
    20Expression s1.setMaximumItemCount(2) is a void method call, and thus it cannot be parameterized
    21Unmatched statement assertEquals(0,s1.indexOf(new XYCoordinate(1.0,1.0))); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    22Expression assertEquals(1,s1.indexOf(new XYCoordinate(3.0,3.0))) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    23Expression assertEquals(2.0,s1.getX(0).doubleValue(),EPSILON) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    24Expression assertEquals(1,s1.indexOf(new XYCoordinate(3.0,3.0))) is a void method call, and thus it cannot be parameterized
    25Expression assertEquals(2.0,s1.getX(0).doubleValue(),EPSILON) is a void method call, and thus it cannot be parameterized
    26Expression assertEquals(2,s1.indexOf(new XYCoordinate(2.0,2.0))) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    27Expression assertEquals(3.0,s1.getX(1).doubleValue(),EPSILON) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    28Expression assertEquals(2,s1.indexOf(new XYCoordinate(2.0,2.0))) is a void method call, and thus it cannot be parameterized
    29Expression assertEquals(3.0,s1.getX(1).doubleValue(),EPSILON) is a void method call, and thus it cannot be parameterized
    30Clone 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.XYIntervalSeries