217-1-2

public static JFreeChart createAreaChart(String title, String categoryAxisLabel, String valueAxisLabel, CategoryDataset dataset, PlotOrientation orientation, boolean legend, boolean tooltips, boolean urls) { 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;
public static JFreeChart createLineChart(String title, String categoryAxisLabel, String valueAxisLabel, CategoryDataset dataset, PlotOrientation orientation, boolean legend, boolean tooltips, boolean urls) { if (orientation == null) { throw new IllegalArgumentException("Null 'orientation' argument."); } CategoryAxis categoryAxis = new CategoryAxis(categoryAxisLabel); ValueAxis valueAxis = new NumberAxis(valueAxisLabel); LineAndShapeRenderer renderer = new LineAndShapeRenderer(true, false); 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: `` |  | Method name: ``
Number of AST nodes: 0 |  | Number of AST nodes: 0

1

    public static JFreeChart createAreaChart(String title,↵

1

    public static JFreeChart createLineChart(String title,↵

2

                                                 String categoryAxisLabel,↵

2

                                                 String categoryAxisLabel,↵

3

                                                 String valueAxisLabel,↵

3

                                                 String valueAxisLabel,↵

4

                                                 CategoryDataset dataset,↵

4

                                                 CategoryDataset dataset,↵

5

                                                 PlotOrientation orientation,↵

5

                                                 PlotOrientation orientation,↵

6

                                                 boolean legend,↵

6

                                                 boolean legend,↵

7

                                                 boolean tooltips,↵

7

                                                 boolean tooltips,↵

8

                                                 boolean urls) {↵

8

                                                 boolean urls) {↵

9

            if (orientation == null) {↵

9

            if (orientation == null) {↵

10

                throw new IllegalArgumentException("Null 'orientation' argument.");↵

10

                throw new IllegalArgumentException("Null 'orientation' argument.");↵

11

            }↵

11

            }↵

12

            CategoryAxis categoryAxis = new CategoryAxis(categoryAxisLabel);↵

12

            CategoryAxis categoryAxis = new CategoryAxis(categoryAxisLabel);↵

13

            categoryAxis.setCategoryMargin(0.0);↵

14

            ValueAxis valueAxis = new NumberAxis(valueAxisLabel);↵

13

            ValueAxis valueAxis = new NumberAxis(valueAxisLabel);↵

15

            AreaRenderer renderer = new AreaRenderer();↵

14

            LineAndShapeRenderer renderer = new LineAndShapeRenderer(true, false);↵

16

            if (tooltips) {↵

15

            if (tooltips) {↵

17

                renderer.setBaseToolTipGenerator(↵

16

                renderer.setBaseToolTipGenerator(↵

18

                        new StandardCategoryToolTipGenerator());↵

17

                        new StandardCategoryToolTipGenerator());↵

19

            }↵

18

            }↵

20

            if (urls) {↵

19

            if (urls) {↵

21

                renderer.setBaseItemURLGenerator(↵

20

                renderer.setBaseItemURLGenerator(↵

22

                        new StandardCategoryURLGenerator());↵

21

                        new StandardCategoryURLGenerator());↵

23

            }↵

22

            }↵

24

            CategoryPlot plot = new CategoryPlot(dataset, categoryAxis, valueAxis, ↵

23

            CategoryPlot plot = new CategoryPlot(dataset, categoryAxis, valueAxis, ↵

25

                    renderer);↵

24

                    renderer);↵

26

            plot.setOrientation(orientation);↵

25

            plot.setOrientation(orientation);↵

27

            JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT,↵

26

            JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT,↵

28

                    plot, legend);↵

27

                    plot, legend);↵

29

            return chart;

28

            return chart;

See real code fragment |  | See real code fragment

Summary
Number of common nesting structure subtrees | 0
Number of refactorable cases | 0
Number of non-refactorable cases | 0
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.0
Clones location |
Number of node comparisons | 0