TableXYDataset dataset = RendererXYPackageTests.createTestTableXYDataset(); JFreeChart chart = ChartFactory.createStackedXYAreaChart( "Test Chart", "X", "Y", dataset, PlotOrientation.VERTICAL, false, false, false); XYPlot plot = (XYPlot) chart.getPlot(); plot.setRenderer(new StackedXYBarRenderer()); NumberAxis domainAxis = (NumberAxis) plot.getDomainAxis(); domainAxis.setAutoRangeIncludesZero(false); Range bounds = domainAxis.getRange(); assertFalse(bounds.contains(0.3)); assertTrue(bounds.contains(0.5)); assertTrue(bounds.contains(2.5)); assertFalse(bounds.contains(2.8));
XYSeriesCollection dataset = RendererXYPackageTests.createTestXYSeriesCollection(); JFreeChart chart = ChartFactory.createXYBarChart("Test Chart", "X", false, "Y", dataset, PlotOrientation.VERTICAL, false, false, false); XYPlot plot = (XYPlot) chart.getPlot(); NumberAxis domainAxis = (NumberAxis) plot.getDomainAxis(); domainAxis.setAutoRangeIncludesZero(false); Range bounds = domainAxis.getRange(); assertFalse(bounds.contains(0.3)); assertTrue(bounds.contains(0.5)); assertTrue(bounds.contains(2.5)); assertFalse(bounds.contains(2.8));
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/tests/org/jfree/chart/renderer/xy/junit/StackedXYBarRendererTests.java File path: /jfreechart-1.0.10/tests/org/jfree/chart/renderer/xy/junit/XYBarRendererTests.java
Method name: void testFindDomainBounds() Method name: void testFindDomainBounds()
Number of AST nodes: 11 Number of AST nodes: 10
1
TableXYDataset dataset
1
XYSeriesCollection dataset
2
                = RendererXYPackageTests.createTestTableXYDataset();
2
                = RendererXYPackageTests.createTestXYSeriesCollection();
3
        JFreeChart chart = ChartFactory.createStackedXYAreaChart(
3
        JFreeChart chart = ChartFactory.create
4
                "Test Chart", "X", "Y", dataset,
5
               
4
XYBarChart("Test Chart", "X",
6
 PlotOrientation.VERTICAL, false, false,
5
                false, "Y", dataset, PlotOrientation.VERTICAL, false, false,
7
 false);
6
                false);
8
        XYPlot plot = (XYPlot) chart.getPlot();
7
        XYPlot plot = (XYPlot) chart.getPlot();
9
        plot.setRenderer(new StackedXYBarRenderer());
10
        NumberAxis domainAxis = (NumberAxis) plot.getDomainAxis();
8
        NumberAxis domainAxis = (NumberAxis) plot.getDomainAxis();
11
        domainAxis.setAutoRangeIncludesZero(false);
9
        domainAxis.setAutoRangeIncludesZero(false);
12
        Range bounds = domainAxis.getRange();
10
        Range bounds = domainAxis.getRange();
13
        assertFalse(bounds.contains(0.3));
11
        assertFalse(bounds.contains(0.3));
14
        assertTrue(bounds.contains(0.5));
12
        assertTrue(bounds.contains(0.5));
15
        assertTrue(bounds.contains(2.5));
13
        assertTrue(bounds.contains(2.5));
16
        assertFalse(bounds.contains(2.8));
14
        assertFalse(bounds.contains(2.8));
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 comparisons76
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements10
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    1
    TableXYDataset dataset = RendererXYPackageTests.createTestTableXYDataset();
    1
    TableXYDataset dataset = RendererXYPackageTests.createTestTableXYDataset();
    1
    XYSeriesCollection dataset = RendererXYPackageTests.createTestXYSeriesCollection();
    Differences
    Expression1Expression2Difference
    org.jfree.data.xy.TableXYDatasetorg.jfree.data.xy.XYSeriesCollectionSUBCLASS_TYPE_MISMATCH
    org.jfree.data.xy.TableXYDatasetorg.jfree.data.xy.XYSeriesCollectionSUBCLASS_TYPE_MISMATCH
    createTestTableXYDatasetcreateTestXYSeriesCollectionMETHOD_INVOCATION_NAME_MISMATCH
    1
    XYSeriesCollection dataset = RendererXYPackageTests.createTestXYSeriesCollection();
    2
    JFreeChart chart = ChartFactory.createStackedXYAreaChart("Test Chart", "X", "Y", dataset, PlotOrientation.VERTICAL, false, false, false);
    2
    JFreeChart chart = ChartFactory.createStackedXYAreaChart("Test Chart", "X", "Y", dataset, PlotOrientation.VERTICAL, false, false, false);
    2
    JFreeChart chart = ChartFactory.createXYBarChart("Test Chart", "X", false, "Y", dataset, PlotOrientation.VERTICAL, false, false, false);
    Differences
    Expression1Expression2Difference
    createStackedXYAreaChartcreateXYBarChartMETHOD_INVOCATION_NAME_MISMATCH
    ChartFactory.createStackedXYAreaChart("Test Chart","X","Y",dataset,PlotOrientation.VERTICAL,false,false,false)ChartFactory.createXYBarChart("Test Chart","X",false,"Y",dataset,PlotOrientation.VERTICAL,false,false,false)ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression ChartFactory.createStackedXYAreaChart("Test Chart","X","Y",dataset,PlotOrientation.VERTICAL,false,false,false) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression ChartFactory.createXYBarChart("Test Chart","X",false,"Y",dataset,PlotOrientation.VERTICAL,false,false,false) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression ChartFactory.createStackedXYAreaChart("Test Chart","X","Y",dataset,PlotOrientation.VERTICAL,false,false,false) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression ChartFactory.createXYBarChart("Test Chart","X",false,"Y",dataset,PlotOrientation.VERTICAL,false,false,false) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2
    JFreeChart chart = ChartFactory.createXYBarChart("Test Chart", "X", false, "Y", dataset, PlotOrientation.VERTICAL, false, false, false);
    3
    XYPlot plot = (XYPlot)chart.getPlot();
    3
    XYPlot plot = (XYPlot)chart.getPlot();
    4
    plot.setRenderer(new StackedXYBarRenderer());
    4
    plot.setRenderer(new StackedXYBarRenderer());
    Preondition Violations
    Unmatched statement plot.setRenderer(new StackedXYBarRenderer()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                                    
    5
    NumberAxis domainAxis = (NumberAxis)plot.getDomainAxis();
    4
    NumberAxis domainAxis = (NumberAxis)plot.getDomainAxis();
    6
    domainAxis.setAutoRangeIncludesZero(false);
    5
    domainAxis.setAutoRangeIncludesZero(false);
    7
    Range bounds = domainAxis.getRange();
    6
    Range bounds = domainAxis.getRange();
    8
    assertFalse(bounds.contains(0.3));
    7
    assertFalse(bounds.contains(0.3));
    9
    assertTrue(bounds.contains(0.5));
    8
    assertTrue(bounds.contains(0.5));
    10
    assertTrue(bounds.contains(2.5));
    9
    assertTrue(bounds.contains(2.5));
    11
    assertFalse(bounds.contains(2.8));
    10
    assertFalse(bounds.contains(2.8));
    Precondition Violations (5)
    Row Violation
    1Expression ChartFactory.createStackedXYAreaChart("Test Chart","X","Y",dataset,PlotOrientation.VERTICAL,false,false,false) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression ChartFactory.createXYBarChart("Test Chart","X",false,"Y",dataset,PlotOrientation.VERTICAL,false,false,false) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression ChartFactory.createStackedXYAreaChart("Test Chart","X","Y",dataset,PlotOrientation.VERTICAL,false,false,false) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression ChartFactory.createXYBarChart("Test Chart","X",false,"Y",dataset,PlotOrientation.VERTICAL,false,false,false) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Unmatched statement plot.setRenderer(new StackedXYBarRenderer()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted