283-1-2

public LegendItem getLegendItem(int datasetIndex, int series) { LegendItem result = null; XYPlot xyplot = getPlot(); if (xyplot != null) { XYDataset dataset = xyplot.getDataset(datasetIndex); if (dataset != null) { XYSeriesLabelGenerator lg = getLegendItemLabelGenerator(); String label = lg.generateLabel(dataset, series); String description = label; String toolTipText = null; if (getLegendItemToolTipGenerator() != null) { toolTipText = getLegendItemToolTipGenerator().generateLabel( dataset, series); } String urlText = null; if (getLegendItemURLGenerator() != null) { urlText = getLegendItemURLGenerator().generateLabel( dataset, series); } Paint paint = lookupSeriesPaint(series); result = new LegendItem(label, description, toolTipText, urlText, this.legendArea, paint); result.setDataset(dataset); result.setDatasetIndex(datasetIndex); result.setSeriesKey(dataset.getSeriesKey(series)); result.setSeriesIndex(series); } } return result;
public LegendItem getLegendItem(int datasetIndex, int series) { LegendItem result = null; XYPlot xyplot = getPlot(); if (xyplot != null) { XYDataset dataset = xyplot.getDataset(datasetIndex); if (dataset != null) { XYSeriesLabelGenerator lg = getLegendItemLabelGenerator(); String label = lg.generateLabel(dataset, series); String description = label; String toolTipText = null; if (getLegendItemToolTipGenerator() != null) { toolTipText = getLegendItemToolTipGenerator().generateLabel( dataset, series); } String urlText = null; if (getLegendItemURLGenerator() != null) { urlText = getLegendItemURLGenerator().generateLabel( dataset, series); } Paint paint = lookupSeriesPaint(series); result = new LegendItem(label, description, toolTipText, urlText, this.legendArea, paint); result.setDataset(dataset); result.setDatasetIndex(datasetIndex); result.setSeriesKey(dataset.getSeriesKey(series)); result.setSeriesIndex(series); } } return result;

Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/xy/XYAreaRenderer.java |  | File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/xy/XYAreaRenderer2.java
Method name: `` |  | Method name: ``
Number of AST nodes: 0 |  | Number of AST nodes: 0

1

    public LegendItem getLegendItem(int datasetIndex, int series) {↵

1

    public LegendItem getLegendItem(int datasetIndex, int series) {↵

2

            LegendItem result = null;↵

2

            LegendItem result = null;↵

3

            XYPlot xyplot = getPlot();↵

3

            XYPlot xyplot = getPlot();↵

4

            if (xyplot != null) {↵

4

            if (xyplot != null) {↵

5

                XYDataset dataset = xyplot.getDataset(datasetIndex);↵

5

                XYDataset dataset = xyplot.getDataset(datasetIndex);↵

6

                if (dataset != null) {↵

6

                if (dataset != null) {↵

7

                    XYSeriesLabelGenerator lg = getLegendItemLabelGenerator();↵

7

                    XYSeriesLabelGenerator lg = getLegendItemLabelGenerator();↵

8

                    String label = lg.generateLabel(dataset, series);↵

8

                    String label = lg.generateLabel(dataset, series);↵

9

                    String description = label;↵

9

                    String description = label;↵

10

                    String toolTipText = null;↵

10

                    String toolTipText = null;↵

11

                    if (getLegendItemToolTipGenerator() != null) {↵

11

                    if (getLegendItemToolTipGenerator() != null) {↵

12

                        toolTipText = getLegendItemToolTipGenerator().generateLabel(↵

12

                        toolTipText = getLegendItemToolTipGenerator().generateLabel(↵

13

                                dataset, series);↵

13

                                dataset, series);↵

14

                    }↵

14

                    }↵

15

                    String urlText = null;↵

15

                    String urlText = null;↵

16

                    if (getLegendItemURLGenerator() != null) {↵

16

                    if (getLegendItemURLGenerator() != null) {↵

17

                        urlText = getLegendItemURLGenerator().generateLabel(↵

17

                        urlText = getLegendItemURLGenerator().generateLabel(↵

18

                                dataset, series);↵

18

                                dataset, series);↵

19

                    }↵

19

                    }↵

20

                    Paint paint = lookupSeriesPaint(series);↵

20

                    Paint paint = lookupSeriesPaint(series);↵

21

                    result = new LegendItem(label, description, toolTipText, ↵

21

                    result = new LegendItem(label, description, toolTipText, ↵

22

                            urlText, this.legendArea, paint);↵

22

                            urlText, this.legendArea, paint);↵

23

                    result.setDataset(dataset);↵

23

                    result.setDataset(dataset);↵

24

                    result.setDatasetIndex(datasetIndex);↵

24

                    result.setDatasetIndex(datasetIndex);↵

25

                    result.setSeriesKey(dataset.getSeriesKey(series));↵

25

                    result.setSeriesKey(dataset.getSeriesKey(series));↵

26

                    result.setSeriesIndex(series);↵

26

                    result.setSeriesIndex(series);↵

27

                }↵

27

                }↵

28

            }↵

28

            }↵

29

            return result;↵

29

            return result;↵

30

30

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