LogAxis axis = new LogAxis("X"); axis.setRange(0.0, 10.0); axis.setLowerBound(5.0); assertEquals(5.0, axis.getLowerBound(), EPSILON); axis.setLowerBound(10.0); assertEquals(10.0, axis.getLowerBound(), EPSILON); assertEquals(11.0, axis.getUpperBound(), EPSILON);
DefaultCategoryDataset dataset = new DefaultCategoryDataset(); dataset.addValue(10.0, "Series 1", "Start"); dataset.addValue(15.0, "Series 1", "Delta 1"); dataset.addValue(-7.0, "Series 1", "Delta 2"); Range range = DatasetUtilities.findCumulativeRangeBounds(dataset); assertEquals(0.0, range.getLowerBound(), 0.00000001); assertEquals(25.0, range.getUpperBound(), 0.00000001);
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/tests/org/jfree/chart/axis/junit/LogAxisTests.java File path: /jfreechart-1.0.10/tests/org/jfree/data/general/junit/DatasetUtilitiesTests.java
Method name: void testSetLowerBound() Method name: void testCumulativeRange1()
Number of AST nodes: 7 Number of AST nodes: 7
1
LogAxis axis = new LogAxis("X");
1
DefaultCategoryDataset dataset = new DefaultCategoryDataset();
2
        axis.setRange(0.0, 10.0);
2
        dataset.addValue(10.0, 
3
        axis.setLowerBound(5.0
3
"Series 1", "Start");
4
);
4
        dataset.addValue(15.0, "Series 1", "Delta 1");
5
        assertEquals(5.0, axis.getLowerBound(), EPSILON);
5
        
6
        axis.setLowerBound(10.0
6
dataset.addValue(-7.0, "Series 1", "Delta 2");
7
);
7
        Range range = DatasetUtilities.findCumulativeRangeBounds(dataset);
8
        assertEquals(10.0, axis.getLowerBound(), EPSILON);
8
        assertEquals(0.0, range.getLowerBound(), 0.00000001);
9
        assertEquals(11.0, axis.getUpperBound(), EPSILON);
9
        assertEquals(25.0, range.getUpperBound(), 0.00000001);
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 comparisons25
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements4
    Number of unmapped statements in the first code fragment3
    Number of unmapped statements in the second code fragment3
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    LogAxis axis = new LogAxis("X");
    1
    LogAxis axis = new LogAxis("X");
    1
    DefaultCategoryDataset dataset = new DefaultCategoryDataset();
    Differences
    Expression1Expression2Difference
    org.jfree.chart.axis.LogAxisorg.jfree.data.category.DefaultCategoryDatasetSUBCLASS_TYPE_MISMATCH
    axisdatasetVARIABLE_NAME_MISMATCH
    org.jfree.chart.axis.LogAxisorg.jfree.data.category.DefaultCategoryDatasetSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.axis.LogAxisorg.jfree.data.category.DefaultCategoryDatasetSUBCLASS_TYPE_MISMATCH
    new LogAxis("X")new DefaultCategoryDataset()ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression new LogAxis("X") cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression new DefaultCategoryDataset() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression new LogAxis("X") cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression new DefaultCategoryDataset() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    1
    DefaultCategoryDataset dataset = new DefaultCategoryDataset();
    2
    axis.setRange(0.0, 10.0);
    2
    axis.setRange(0.0, 10.0);
    2
    dataset.addValue(10.0, "Series 1", "Start");
    Differences
    Expression1Expression2Difference
    setRangeaddValueMETHOD_INVOCATION_NAME_MISMATCH
    axisdatasetVARIABLE_NAME_MISMATCH
    org.jfree.chart.axis.LogAxisorg.jfree.data.category.DefaultCategoryDatasetSUBCLASS_TYPE_MISMATCH
    axis.setRange(0.0,10.0)dataset.addValue(10.0,"Series 1","Start")ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression axis.setRange(0.0,10.0) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression dataset.addValue(10.0,"Series 1","Start") cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression axis.setRange(0.0,10.0) is a void method call, and thus it cannot be parameterized
    Expression dataset.addValue(10.0,"Series 1","Start") is a void method call, and thus it cannot be parameterized
    Expression axis cannot be unified with expression dataset , because common superclass org.jfree.util.PublicCloneable does not declare member(s) public void setRange(double, double) , public void addValue(double, Comparable#RAW, Comparable#RAW)
    Expression axis.setRange(0.0,10.0) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression dataset.addValue(10.0,"Series 1","Start") cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression axis.setRange(0.0,10.0) is a void method call, and thus it cannot be parameterized
    Expression dataset.addValue(10.0,"Series 1","Start") is a void method call, and thus it cannot be parameterized
    2
    dataset.addValue(10.0, "Series 1", "Start");
    3
    axis.setLowerBound(5.0);
    3
    axis.setLowerBound(5.0);
    3
    dataset.addValue(15.0, "Series 1", "Delta 1");
    Differences
    Expression1Expression2Difference
    setLowerBoundaddValueMETHOD_INVOCATION_NAME_MISMATCH
    axisdatasetVARIABLE_NAME_MISMATCH
    org.jfree.chart.axis.LogAxisorg.jfree.data.category.DefaultCategoryDatasetSUBCLASS_TYPE_MISMATCH
    axis.setLowerBound(5.0)dataset.addValue(15.0,"Series 1","Delta 1")ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression axis.setLowerBound(5.0) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression dataset.addValue(15.0,"Series 1","Delta 1") cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression axis.setLowerBound(5.0) is a void method call, and thus it cannot be parameterized
    Expression dataset.addValue(15.0,"Series 1","Delta 1") is a void method call, and thus it cannot be parameterized
    Expression axis cannot be unified with expression dataset , because common superclass org.jfree.util.PublicCloneable does not declare member(s) public void setLowerBound(double) , public void addValue(double, Comparable#RAW, Comparable#RAW)
    Expression axis.setLowerBound(5.0) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression dataset.addValue(15.0,"Series 1","Delta 1") cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression axis.setLowerBound(5.0) is a void method call, and thus it cannot be parameterized
    Expression dataset.addValue(15.0,"Series 1","Delta 1") is a void method call, and thus it cannot be parameterized
    3
    dataset.addValue(15.0, "Series 1", "Delta 1");
    4
    assertEquals(5.0, axis.getLowerBound(), EPSILON);
    4
    assertEquals(5.0, axis.getLowerBound(), EPSILON);
    Preondition Violations
    Unmatched statement assertEquals(5.0,axis.getLowerBound(),EPSILON); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                                        
    5
    axis.setLowerBound(10.0);
    5
    axis.setLowerBound(10.0);
    4
    dataset.addValue(-7.0, "Series 1", "Delta 2");
    Differences
    Expression1Expression2Difference
    setLowerBoundaddValueMETHOD_INVOCATION_NAME_MISMATCH
    axisdatasetVARIABLE_NAME_MISMATCH
    org.jfree.chart.axis.LogAxisorg.jfree.data.category.DefaultCategoryDatasetSUBCLASS_TYPE_MISMATCH
    axis.setLowerBound(10.0)dataset.addValue(-7.0,"Series 1","Delta 2")ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression axis.setLowerBound(10.0) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression dataset.addValue(-7.0,"Series 1","Delta 2") cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression axis.setLowerBound(10.0) is a void method call, and thus it cannot be parameterized
    Expression dataset.addValue(-7.0,"Series 1","Delta 2") is a void method call, and thus it cannot be parameterized
    Expression axis cannot be unified with expression dataset , because common superclass org.jfree.util.PublicCloneable does not declare member(s) public void setLowerBound(double) , public void addValue(double, Comparable#RAW, Comparable#RAW)
    Expression axis.setLowerBound(10.0) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression dataset.addValue(-7.0,"Series 1","Delta 2") cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression axis.setLowerBound(10.0) is a void method call, and thus it cannot be parameterized
    Expression dataset.addValue(-7.0,"Series 1","Delta 2") is a void method call, and thus it cannot be parameterized
    4
    dataset.addValue(-7.0, "Series 1", "Delta 2");
                                                                                                                                          
    5
    Range range = DatasetUtilities.findCumulativeRangeBounds(dataset);
    Preondition Violations
    Unmatched statement Range range=DatasetUtilities.findCumulativeRangeBounds(dataset); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    5
    Range range = DatasetUtilities.findCumulativeRangeBounds(dataset);
                                                                                                                
    6
    assertEquals(0.0, range.getLowerBound(), 0.00000001);
    6
    assertEquals(10.0, axis.getLowerBound(), EPSILON);
    6
    assertEquals(10.0, axis.getLowerBound(), EPSILON);
    Preondition Violations
    Unmatched statement assertEquals(10.0,axis.getLowerBound(),EPSILON); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                                          
                                                                                                                  
    7
    assertEquals(25.0, range.getUpperBound(), 0.00000001);
    7
    assertEquals(11.0, axis.getUpperBound(), EPSILON);
    7
    assertEquals(11.0, axis.getUpperBound(), EPSILON);
    Preondition Violations
    Unmatched statement assertEquals(11.0,axis.getUpperBound(),EPSILON); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                                          
    Precondition Violations (36)
    Row Violation
    1Expression new LogAxis("X") cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression new DefaultCategoryDataset() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression new LogAxis("X") cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression new DefaultCategoryDataset() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression axis.setRange(0.0,10.0) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression dataset.addValue(10.0,"Series 1","Start") cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression axis.setRange(0.0,10.0) is a void method call, and thus it cannot be parameterized
    8Expression dataset.addValue(10.0,"Series 1","Start") is a void method call, and thus it cannot be parameterized
    9Expression axis cannot be unified with expression dataset , because common superclass org.jfree.util.PublicCloneable does not declare member(s) public void setRange(double, double) , public void addValue(double, Comparable#RAW, Comparable#RAW)
    10Expression axis.setRange(0.0,10.0) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    11Expression dataset.addValue(10.0,"Series 1","Start") cannot be parameterized, because it has dependencies to/from statements that will be extracted
    12Expression axis.setRange(0.0,10.0) is a void method call, and thus it cannot be parameterized
    13Expression dataset.addValue(10.0,"Series 1","Start") is a void method call, and thus it cannot be parameterized
    14Expression axis.setLowerBound(5.0) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    15Expression dataset.addValue(15.0,"Series 1","Delta 1") cannot be parameterized, because it has dependencies to/from statements that will be extracted
    16Expression axis.setLowerBound(5.0) is a void method call, and thus it cannot be parameterized
    17Expression dataset.addValue(15.0,"Series 1","Delta 1") is a void method call, and thus it cannot be parameterized
    18Expression axis cannot be unified with expression dataset , because common superclass org.jfree.util.PublicCloneable does not declare member(s) public void setLowerBound(double) , public void addValue(double, Comparable#RAW, Comparable#RAW)
    19Expression axis.setLowerBound(5.0) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    20Expression dataset.addValue(15.0,"Series 1","Delta 1") cannot be parameterized, because it has dependencies to/from statements that will be extracted
    21Expression axis.setLowerBound(5.0) is a void method call, and thus it cannot be parameterized
    22Expression dataset.addValue(15.0,"Series 1","Delta 1") is a void method call, and thus it cannot be parameterized
    23Unmatched statement assertEquals(5.0,axis.getLowerBound(),EPSILON); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    24Expression axis.setLowerBound(10.0) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    25Expression dataset.addValue(-7.0,"Series 1","Delta 2") cannot be parameterized, because it has dependencies to/from statements that will be extracted
    26Expression axis.setLowerBound(10.0) is a void method call, and thus it cannot be parameterized
    27Expression dataset.addValue(-7.0,"Series 1","Delta 2") is a void method call, and thus it cannot be parameterized
    28Expression axis cannot be unified with expression dataset , because common superclass org.jfree.util.PublicCloneable does not declare member(s) public void setLowerBound(double) , public void addValue(double, Comparable#RAW, Comparable#RAW)
    29Expression axis.setLowerBound(10.0) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    30Expression dataset.addValue(-7.0,"Series 1","Delta 2") cannot be parameterized, because it has dependencies to/from statements that will be extracted
    31Expression axis.setLowerBound(10.0) is a void method call, and thus it cannot be parameterized
    32Expression dataset.addValue(-7.0,"Series 1","Delta 2") is a void method call, and thus it cannot be parameterized
    33Unmatched statement Range range=DatasetUtilities.findCumulativeRangeBounds(dataset); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    34Unmatched statement assertEquals(10.0,axis.getLowerBound(),EPSILON); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    35Unmatched statement assertEquals(11.0,axis.getUpperBound(),EPSILON); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    36Clone fragment #1 returns variable axis with type org.jfree.chart.axis.LogAxis , while Clone fragment #2 returns variable dataset with type org.jfree.data.category.DefaultCategoryDataset