DefaultKeyedValues2D d = new DefaultKeyedValues2D(); assertEquals(0, d.getColumnCount()); d.addValue(new Double(1.0), "R1", "C1"); assertEquals(1, d.getColumnCount()); d.addValue(new Double(2.0), "R1", "C2"); assertEquals(2, d.getColumnCount());
SimpleHistogramDataset d1 = new SimpleHistogramDataset("D1"); d1.clearObservations(); assertEquals(0, d1.getItemCount(0)); d1.addBin(new SimpleHistogramBin(0.0, 1.0)); d1.addObservation(0.5); assertEquals(1.0, d1.getYValue(0, 0), EPSILON);
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/tests/org/jfree/data/junit/DefaultKeyedValues2DTests.java File path: /jfreechart-1.0.10/tests/org/jfree/data/statistics/junit/SimpleHistogramDatasetTests.java
Method name: void testColumnCount() Method name: void testClearObservations()
Number of AST nodes: 6 Number of AST nodes: 6
1
DefaultKeyedValues2D d = new DefaultKeyedValues2D
1
SimpleHistogramDataset d1 = new SimpleHistogramDataset("D1");
2
();
2
        d1.clearObservations();
3
        assertEquals(0, d.getColumnCount());
3
        assertEquals(0, d1.getItemCount(0));
4
        d.addValue(new Double(1.0), "R1", "C1");
4
        d1.add
5
        assertEquals(1, d.getColumnCount());
5
Bin(new SimpleHistogramBin(0.0, 1.0));
6
        d.addValue(new Double(2.0), "R1", "C2");
6
        d1.addObservation(0.5);
7
        assertEquals(2, d.getColumnCount());
7
        assertEquals(1.0, d1.getYValue(0, 0), 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 comparisons22
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements5
    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
    DefaultKeyedValues2D d = new DefaultKeyedValues2D();
    1
    DefaultKeyedValues2D d = new DefaultKeyedValues2D();
    1
    SimpleHistogramDataset d1 = new SimpleHistogramDataset("D1");
    Differences
    Expression1Expression2Difference
    org.jfree.data.DefaultKeyedValues2Dorg.jfree.data.statistics.SimpleHistogramDatasetSUBCLASS_TYPE_MISMATCH
    dd1VARIABLE_NAME_MISMATCH
    org.jfree.data.DefaultKeyedValues2Dorg.jfree.data.statistics.SimpleHistogramDatasetSUBCLASS_TYPE_MISMATCH
    org.jfree.data.DefaultKeyedValues2Dorg.jfree.data.statistics.SimpleHistogramDatasetSUBCLASS_TYPE_MISMATCH
    new DefaultKeyedValues2D()new SimpleHistogramDataset("D1")ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression new DefaultKeyedValues2D() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression new SimpleHistogramDataset("D1") cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression new DefaultKeyedValues2D() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression new SimpleHistogramDataset("D1") cannot be parameterized, because it has dependencies to/from statements that will be extracted
    1
    SimpleHistogramDataset d1 = new SimpleHistogramDataset("D1");
                                                        
    2
    d1.clearObservations();
    Preondition Violations
    Unmatched statement d1.clearObservations(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2
    d1.clearObservations();
    2
    assertEquals(0, d.getColumnCount());
    2
    assertEquals(0, d.getColumnCount());
    3
    assertEquals(0, d1.getItemCount(0));
    Differences
    Expression1Expression2Difference
    getColumnCountgetItemCountMETHOD_INVOCATION_NAME_MISMATCH
    dd1VARIABLE_NAME_MISMATCH
    org.jfree.data.DefaultKeyedValues2Dorg.jfree.data.statistics.SimpleHistogramDatasetSUBCLASS_TYPE_MISMATCH
    d.getColumnCount()d1.getItemCount(0)ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression d.getColumnCount() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression d1.getItemCount(0) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression d cannot be unified with expression d1 , because common superclass org.jfree.util.PublicCloneable does not declare member(s) public int getColumnCount() , public int getItemCount(int)
    Expression d.getColumnCount() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression d1.getItemCount(0) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3
    assertEquals(0, d1.getItemCount(0));
    3
    d.addValue(new Double(1.0), "R1", "C1");
    3
    d.addValue(new Double(1.0), "R1", "C1");
    4
    d1.addBin(new SimpleHistogramBin(0.0, 1.0));
    Differences
    Expression1Expression2Difference
    addValueaddBinMETHOD_INVOCATION_NAME_MISMATCH
    dd1VARIABLE_NAME_MISMATCH
    org.jfree.data.DefaultKeyedValues2Dorg.jfree.data.statistics.SimpleHistogramDatasetSUBCLASS_TYPE_MISMATCH
    d.addValue(new Double(1.0),"R1","C1")d1.addBin(new SimpleHistogramBin(0.0,1.0))ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression d.addValue(new Double(1.0),"R1","C1") cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression d1.addBin(new SimpleHistogramBin(0.0,1.0)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression d.addValue(new Double(1.0),"R1","C1") is a void method call, and thus it cannot be parameterized
    Expression d1.addBin(new SimpleHistogramBin(0.0,1.0)) is a void method call, and thus it cannot be parameterized
    Expression d cannot be unified with expression d1 , because common superclass org.jfree.util.PublicCloneable does not declare member(s) public void addValue(java.lang.Number, Comparable#RAW, Comparable#RAW) , public void addBin(org.jfree.data.statistics.SimpleHistogramBin)
    Expression d.addValue(new Double(1.0),"R1","C1") cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression d1.addBin(new SimpleHistogramBin(0.0,1.0)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression d.addValue(new Double(1.0),"R1","C1") is a void method call, and thus it cannot be parameterized
    Expression d1.addBin(new SimpleHistogramBin(0.0,1.0)) is a void method call, and thus it cannot be parameterized
    4
    d1.addBin(new SimpleHistogramBin(0.0, 1.0));
    4
    assertEquals(1, d.getColumnCount());
    4
    assertEquals(1, d.getColumnCount());
    6
    assertEquals(1.0, d1.getYValue(0, 0), EPSILON);
    Differences
    Expression1Expression2Difference
    assertEquals(1,d.getColumnCount())assertEquals(1.0,d1.getYValue(0,0),EPSILON)ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression assertEquals(1,d.getColumnCount()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression assertEquals(1.0,d1.getYValue(0,0),EPSILON) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression assertEquals(1,d.getColumnCount()) is a void method call, and thus it cannot be parameterized
    Expression assertEquals(1.0,d1.getYValue(0,0),EPSILON) is a void method call, and thus it cannot be parameterized
    6
    assertEquals(1.0, d1.getYValue(0, 0), EPSILON);
    5
    d.addValue(new Double(2.0), "R1", "C2");
    5
    d.addValue(new Double(2.0), "R1", "C2");
    5
    d1.addObservation(0.5);
    Differences
    Expression1Expression2Difference
    addValueaddObservationMETHOD_INVOCATION_NAME_MISMATCH
    dd1VARIABLE_NAME_MISMATCH
    org.jfree.data.DefaultKeyedValues2Dorg.jfree.data.statistics.SimpleHistogramDatasetSUBCLASS_TYPE_MISMATCH
    d.addValue(new Double(2.0),"R1","C2")d1.addObservation(0.5)ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression d.addValue(new Double(2.0),"R1","C2") cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression d1.addObservation(0.5) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression d.addValue(new Double(2.0),"R1","C2") is a void method call, and thus it cannot be parameterized
    Expression d1.addObservation(0.5) is a void method call, and thus it cannot be parameterized
    Expression d cannot be unified with expression d1 , because common superclass org.jfree.util.PublicCloneable does not declare member(s) public void addValue(java.lang.Number, Comparable#RAW, Comparable#RAW) , public void addObservation(double)
    Expression d.addValue(new Double(2.0),"R1","C2") cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression d1.addObservation(0.5) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression d.addValue(new Double(2.0),"R1","C2") is a void method call, and thus it cannot be parameterized
    Expression d1.addObservation(0.5) is a void method call, and thus it cannot be parameterized
    5
    d1.addObservation(0.5);
    6
    assertEquals(2, d.getColumnCount());
    6
    assertEquals(2, d.getColumnCount());
    Preondition Violations
    Unmatched statement assertEquals(2,d.getColumnCount()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                
    Precondition Violations (34)
    Row Violation
    1Expression new DefaultKeyedValues2D() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression new SimpleHistogramDataset("D1") cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression new DefaultKeyedValues2D() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression new SimpleHistogramDataset("D1") cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Unmatched statement d1.clearObservations(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    6Expression d.getColumnCount() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression d1.getItemCount(0) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Expression d cannot be unified with expression d1 , because common superclass org.jfree.util.PublicCloneable does not declare member(s) public int getColumnCount() , public int getItemCount(int)
    9Expression d.getColumnCount() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10Expression d1.getItemCount(0) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    11Expression d.addValue(new Double(1.0),"R1","C1") cannot be parameterized, because it has dependencies to/from statements that will be extracted
    12Expression d1.addBin(new SimpleHistogramBin(0.0,1.0)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    13Expression d.addValue(new Double(1.0),"R1","C1") is a void method call, and thus it cannot be parameterized
    14Expression d1.addBin(new SimpleHistogramBin(0.0,1.0)) is a void method call, and thus it cannot be parameterized
    15Expression d cannot be unified with expression d1 , because common superclass org.jfree.util.PublicCloneable does not declare member(s) public void addValue(java.lang.Number, Comparable#RAW, Comparable#RAW) , public void addBin(org.jfree.data.statistics.SimpleHistogramBin)
    16Expression d.addValue(new Double(1.0),"R1","C1") cannot be parameterized, because it has dependencies to/from statements that will be extracted
    17Expression d1.addBin(new SimpleHistogramBin(0.0,1.0)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    18Expression d.addValue(new Double(1.0),"R1","C1") is a void method call, and thus it cannot be parameterized
    19Expression d1.addBin(new SimpleHistogramBin(0.0,1.0)) is a void method call, and thus it cannot be parameterized
    20Expression assertEquals(1,d.getColumnCount()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    21Expression assertEquals(1.0,d1.getYValue(0,0),EPSILON) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    22Expression assertEquals(1,d.getColumnCount()) is a void method call, and thus it cannot be parameterized
    23Expression assertEquals(1.0,d1.getYValue(0,0),EPSILON) is a void method call, and thus it cannot be parameterized
    24Expression d.addValue(new Double(2.0),"R1","C2") cannot be parameterized, because it has dependencies to/from statements that will be extracted
    25Expression d1.addObservation(0.5) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    26Expression d.addValue(new Double(2.0),"R1","C2") is a void method call, and thus it cannot be parameterized
    27Expression d1.addObservation(0.5) is a void method call, and thus it cannot be parameterized
    28Expression d cannot be unified with expression d1 , because common superclass org.jfree.util.PublicCloneable does not declare member(s) public void addValue(java.lang.Number, Comparable#RAW, Comparable#RAW) , public void addObservation(double)
    29Expression d.addValue(new Double(2.0),"R1","C2") cannot be parameterized, because it has dependencies to/from statements that will be extracted
    30Expression d1.addObservation(0.5) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    31Expression d.addValue(new Double(2.0),"R1","C2") is a void method call, and thus it cannot be parameterized
    32Expression d1.addObservation(0.5) is a void method call, and thus it cannot be parameterized
    33Unmatched statement assertEquals(2,d.getColumnCount()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    34Clone fragment #1 returns variables d , while Clone fragment #2 returns variables