if (orientation == null) { throw new IllegalArgumentException("Null 'orientation' argument."); } CategoryAxis categoryAxis = new CategoryAxis(categoryAxisLabel); ValueAxis valueAxis = new NumberAxis(valueAxisLabel); StackedAreaRenderer renderer = new StackedAreaRenderer(); 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 createStackedAreaChart(String, String, String, CategoryDataset, PlotOrientation, boolean, boolean, boolean) Method name: JFreeChart createLineChart3D(String, String, String, CategoryDataset, PlotOrientation, boolean, boolean, boolean)
Number of AST nodes: 13 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
        ValueAxis valueAxis = new NumberAxis(valueAxisLabel);
5
        ValueAxis valueAxis = new NumberAxis3D(valueAxisLabel);
6
        StackedAreaRenderer renderer = new StackedAreaRenderer();
6
        LineRenderer3D renderer = new LineRenderer3D();
7
        if (tooltips) {
7
        if (tooltips) {
8
            renderer.setBaseToolTipGenerator(
8
            renderer.setBaseToolTipGenerator(
9
                    new StandardCategoryToolTipGenerator());
9
                    new StandardCategoryToolTipGenerator());
10
        }
10
        }
11
        if (urls) {
11
        if (urls) {
12
            renderer.setBaseItemURLGenerator(
12
            renderer.setBaseItemURLGenerator(
13
                    new StandardCategoryURLGenerator());
13
                    new StandardCategoryURLGenerator());
14
        }
14
        }
15
        CategoryPlot plot = new CategoryPlot(dataset, categoryAxis, valueAxis, 
15
        CategoryPlot plot = new CategoryPlot(dataset, categoryAxis, valueAxis, 
16
                renderer);
16
                renderer);
17
        plot.setOrientation(orientation);
17
        plot.setOrientation(orientation);
18
        JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT, 
18
        JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT,
19
                plot, legend);
19
                plot, legend);
20
        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.2
Clones locationClones are declared in the same class
Number of node comparisons36
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements13
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)133.2
    Clone typeType 2
    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
    ValueAxis valueAxis = new NumberAxis(valueAxisLabel);
    4
    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);
    5
    StackedAreaRenderer renderer = new StackedAreaRenderer();
    5
    StackedAreaRenderer renderer = new StackedAreaRenderer();
    5
    LineRenderer3D renderer = new LineRenderer3D();
    Differences
    Expression1Expression2Difference
    org.jfree.chart.renderer.category.StackedAreaRendererorg.jfree.chart.renderer.category.LineRenderer3DSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.renderer.category.StackedAreaRendererorg.jfree.chart.renderer.category.LineRenderer3DSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.renderer.category.StackedAreaRendererorg.jfree.chart.renderer.category.LineRenderer3DSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression new StackedAreaRenderer() 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();
    6
    if (tooltips)
    6
    if (tooltips)
    7
    renderer.setBaseToolTipGenerator(new StandardCategoryToolTipGenerator());
    7
    renderer.setBaseToolTipGenerator(new StandardCategoryToolTipGenerator());
    7
    renderer.setBaseToolTipGenerator(new StandardCategoryToolTipGenerator());
    Differences
    Expression1Expression2Difference
    org.jfree.chart.renderer.category.StackedAreaRendererorg.jfree.chart.renderer.category.LineRenderer3DSUBCLASS_TYPE_MISMATCH
    7
    renderer.setBaseToolTipGenerator(new StandardCategoryToolTipGenerator());
    8
    if (urls)
    8
    if (urls)
    9
    renderer.setBaseItemURLGenerator(new StandardCategoryURLGenerator());
    9
    renderer.setBaseItemURLGenerator(new StandardCategoryURLGenerator());
    9
    renderer.setBaseItemURLGenerator(new StandardCategoryURLGenerator());
    Differences
    Expression1Expression2Difference
    org.jfree.chart.renderer.category.StackedAreaRendererorg.jfree.chart.renderer.category.LineRenderer3DSUBCLASS_TYPE_MISMATCH
    9
    renderer.setBaseItemURLGenerator(new StandardCategoryURLGenerator());
    10
    CategoryPlot plot = new CategoryPlot(dataset, categoryAxis, valueAxis, renderer);
    10
    CategoryPlot plot = new CategoryPlot(dataset, categoryAxis, valueAxis, renderer);
    10
    CategoryPlot plot = new CategoryPlot(dataset, categoryAxis, valueAxis, renderer);
    Differences
    Expression1Expression2Difference
    org.jfree.chart.renderer.category.StackedAreaRendererorg.jfree.chart.renderer.category.LineRenderer3DSUBCLASS_TYPE_MISMATCH
    10
    CategoryPlot plot = new CategoryPlot(dataset, categoryAxis, valueAxis, renderer);
    11
    plot.setOrientation(orientation);
    11
    plot.setOrientation(orientation);
    12
    JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT, plot, legend);
    12
    JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT, plot, legend);
    13
    return chart;
    13
    return chart;
    Precondition Violations (4)
    Row Violation
    1Expression new CategoryAxis(categoryAxisLabel) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression new NumberAxis(valueAxisLabel) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression new StackedAreaRenderer() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression new LineRenderer3D() cannot be parameterized, because it has dependencies to/from statements that will be extracted