if (orientation == null) { throw new IllegalArgumentException("Null 'orientation' argument."); } CategoryAxis categoryAxis = new CategoryAxis(categoryAxisLabel); categoryAxis.setCategoryMargin(0.0); ValueAxis valueAxis = new NumberAxis(valueAxisLabel); AreaRenderer renderer = new AreaRenderer(); if (tooltips) { renderer.setBaseToolTipGenerator( new StandardCategoryToolTipGenerator()); } if (urls) { renderer.setBaseItemURLGenerator( new StandardCategoryURLGenerator()); } CategoryPlot plot = new CategoryPlot(dataset, categoryAxis, valueAxis, renderer); plot.setOrientation(orientation); JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT, plot, legend); return chart;
if (orientation == null) { throw new IllegalArgumentException("Null 'orientation' argument."); } CategoryAxis categoryAxis = new CategoryAxis3D(categoryAxisLabel); ValueAxis valueAxis = new NumberAxis3D(valueAxisLabel); LineRenderer3D renderer = new LineRenderer3D(); if (tooltips) { renderer.setBaseToolTipGenerator( new StandardCategoryToolTipGenerator()); } if (urls) { renderer.setBaseItemURLGenerator( new StandardCategoryURLGenerator()); } CategoryPlot plot = new CategoryPlot(dataset, categoryAxis, valueAxis, renderer); plot.setOrientation(orientation); JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT, plot, legend); return chart;
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/ChartFactory.java File path: /jfreechart-1.0.10/src/org/jfree/chart/ChartFactory.java
Method name: JFreeChart createAreaChart(String, String, String, CategoryDataset, PlotOrientation, boolean, boolean, boolean) Method name: JFreeChart createLineChart3D(String, String, String, CategoryDataset, PlotOrientation, boolean, boolean, boolean)
Number of AST nodes: 14 Number of AST nodes: 13
1
if (orientation == null) {
1
if (orientation == null) {
2
            throw new IllegalArgumentException("Null 'orientation' argument.");
2
            throw new IllegalArgumentException("Null 'orientation' argument.");
3
        }
3
        }
4
        CategoryAxis categoryAxis = new CategoryAxis(categoryAxisLabel);
4
        CategoryAxis categoryAxis = new CategoryAxis3D(categoryAxisLabel);
5
        categoryAxis.setCategoryMargin(0.0);
6
        ValueAxis valueAxis = new NumberAxis(valueAxisLabel);
5
        ValueAxis valueAxis = new NumberAxis3D(valueAxisLabel);
7
        AreaRenderer renderer = new AreaRenderer();
6
        LineRenderer3D renderer = new LineRenderer3D();
8
        if (tooltips) {
7
        if (tooltips) {
9
            renderer.setBaseToolTipGenerator(
8
            renderer.setBaseToolTipGenerator(
10
                    new StandardCategoryToolTipGenerator());
9
                    new StandardCategoryToolTipGenerator());
11
        }
10
        }
12
        if (urls) {
11
        if (urls) {
13
            renderer.setBaseItemURLGenerator(
12
            renderer.setBaseItemURLGenerator(
14
                    new StandardCategoryURLGenerator());
13
                    new StandardCategoryURLGenerator());
15
        }
14
        }
16
        CategoryPlot plot = new CategoryPlot(dataset, categoryAxis, valueAxis, 
15
        CategoryPlot plot = new CategoryPlot(dataset, categoryAxis, valueAxis, 
17
                renderer);
16
                renderer);
18
        plot.setOrientation(orientation);
17
        plot.setOrientation(orientation);
19
        JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT,
18
        JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT,
20
                plot, legend);
19
                plot, legend);
21
        return chart;
20
        return chart;
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.3
Clones locationClones are declared in the same class
Number of node comparisons40
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements13
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)132.2
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    1
    if (orientation == null)
    1
    if (orientation == null)
    2
    throw new IllegalArgumentException("Null 'orientation' argument.");
    2
    throw new IllegalArgumentException("Null 'orientation' argument.");
    3
    CategoryAxis categoryAxis = new CategoryAxis(categoryAxisLabel);
    3
    CategoryAxis categoryAxis = new CategoryAxis(categoryAxisLabel);
    3
    CategoryAxis categoryAxis = new CategoryAxis3D(categoryAxisLabel);
    Differences
    Expression1Expression2Difference
    org.jfree.chart.axis.CategoryAxisorg.jfree.chart.axis.CategoryAxis3DSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression new CategoryAxis(categoryAxisLabel) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3
    CategoryAxis categoryAxis = new CategoryAxis3D(categoryAxisLabel);
    4
    categoryAxis.setCategoryMargin(0.0);
    4
    categoryAxis.setCategoryMargin(0.0);
    Preondition Violations
    Unmatched statement categoryAxis.setCategoryMargin(0.0); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                  
    5
    ValueAxis valueAxis = new NumberAxis(valueAxisLabel);
    5
    ValueAxis valueAxis = new NumberAxis(valueAxisLabel);
    4
    ValueAxis valueAxis = new NumberAxis3D(valueAxisLabel);
    Differences
    Expression1Expression2Difference
    org.jfree.chart.axis.NumberAxisorg.jfree.chart.axis.NumberAxis3DSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression new NumberAxis(valueAxisLabel) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4
    ValueAxis valueAxis = new NumberAxis3D(valueAxisLabel);
    6
    AreaRenderer renderer = new AreaRenderer();
    6
    AreaRenderer renderer = new AreaRenderer();
    5
    LineRenderer3D renderer = new LineRenderer3D();
    Differences
    Expression1Expression2Difference
    org.jfree.chart.renderer.category.AreaRendererorg.jfree.chart.renderer.category.LineRenderer3DSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.renderer.category.AreaRendererorg.jfree.chart.renderer.category.LineRenderer3DSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.renderer.category.AreaRendererorg.jfree.chart.renderer.category.LineRenderer3DSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression new AreaRenderer() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression new LineRenderer3D() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5
    LineRenderer3D renderer = new LineRenderer3D();
    7
    if (tooltips)
    6
    if (tooltips)
    8
    renderer.setBaseToolTipGenerator(new StandardCategoryToolTipGenerator());
    8
    renderer.setBaseToolTipGenerator(new StandardCategoryToolTipGenerator());
    7
    renderer.setBaseToolTipGenerator(new StandardCategoryToolTipGenerator());
    Differences
    Expression1Expression2Difference
    org.jfree.chart.renderer.category.AreaRendererorg.jfree.chart.renderer.category.LineRenderer3DSUBCLASS_TYPE_MISMATCH
    7
    renderer.setBaseToolTipGenerator(new StandardCategoryToolTipGenerator());
    9
    if (urls)
    8
    if (urls)
    10
    renderer.setBaseItemURLGenerator(new StandardCategoryURLGenerator());
    10
    renderer.setBaseItemURLGenerator(new StandardCategoryURLGenerator());
    9
    renderer.setBaseItemURLGenerator(new StandardCategoryURLGenerator());
    Differences
    Expression1Expression2Difference
    org.jfree.chart.renderer.category.AreaRendererorg.jfree.chart.renderer.category.LineRenderer3DSUBCLASS_TYPE_MISMATCH
    9
    renderer.setBaseItemURLGenerator(new StandardCategoryURLGenerator());
    11
    CategoryPlot plot = new CategoryPlot(dataset, categoryAxis, valueAxis, renderer);
    11
    CategoryPlot plot = new CategoryPlot(dataset, categoryAxis, valueAxis, renderer);
    10
    CategoryPlot plot = new CategoryPlot(dataset, categoryAxis, valueAxis, renderer);
    Differences
    Expression1Expression2Difference
    org.jfree.chart.renderer.category.AreaRendererorg.jfree.chart.renderer.category.LineRenderer3DSUBCLASS_TYPE_MISMATCH
    10
    CategoryPlot plot = new CategoryPlot(dataset, categoryAxis, valueAxis, renderer);
    12
    plot.setOrientation(orientation);
    11
    plot.setOrientation(orientation);
    13
    JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT, plot, legend);
    12
    JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT, plot, legend);
    14
    return chart;
    13
    return chart;
    Precondition Violations (5)
    Row Violation
    1Expression new CategoryAxis(categoryAxisLabel) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Unmatched statement categoryAxis.setCategoryMargin(0.0); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3Expression new NumberAxis(valueAxisLabel) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression new AreaRenderer() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression new LineRenderer3D() cannot be parameterized, because it has dependencies to/from statements that will be extracted