228-2-3

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;

See real code fragment |  | See real code fragment

Summary
Number of common nesting structure subtrees | 1
Number of refactorable cases | 1
Number of non-refactorable cases | 0
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.2
Clones location | Clones are declared in the same class
Number of node comparisons | 76

1. {Refactorable}

   Mapping Summary
   Number of mapped statements | 13
   Number of unmapped statements in the first code fragment | 0
   Number of unmapped statements in the second code fragment | 0
   Time elapsed for statement mapping (ms) | 3.1
   Clone type | Type 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
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.chart.axis.CategoryAxis | org.jfree.chart.axis.CategoryAxis3D | SUBCLASS_TYPE_MISMATCH

   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
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.chart.axis.NumberAxis | org.jfree.chart.axis.NumberAxis3D | SUBCLASS_TYPE_MISMATCH

   4

       ValueAxis valueAxis = new NumberAxis3D(valueAxisLabel);

   5

       StackedAreaRenderer renderer = new StackedAreaRenderer();

   5 | StackedAreaRenderer renderer = new StackedAreaRenderer();
   5 | LineRenderer3D renderer = new LineRenderer3D();

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.chart.renderer.category.StackedAreaRenderer | org.jfree.chart.renderer.category.LineRenderer3D | SUBCLASS_TYPE_MISMATCH
   org.jfree.chart.renderer.category.StackedAreaRenderer | org.jfree.chart.renderer.category.LineRenderer3D | SUBCLASS_TYPE_MISMATCH
   org.jfree.chart.renderer.category.StackedAreaRenderer | org.jfree.chart.renderer.category.LineRenderer3D | SUBCLASS_TYPE_MISMATCH

   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
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.chart.renderer.category.StackedAreaRenderer | org.jfree.chart.renderer.category.LineRenderer3D | SUBCLASS_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
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.chart.renderer.category.StackedAreaRenderer | org.jfree.chart.renderer.category.LineRenderer3D | SUBCLASS_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
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.chart.renderer.category.StackedAreaRenderer | org.jfree.chart.renderer.category.LineRenderer3D | SUBCLASS_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 (0)
   Row | Violation
   --- | ---