1571-1-3

if (renderer != null) { int seriesCount = dataset.getRowCount(); for (int i = 0; i < seriesCount; i++) { LegendItem item = renderer.getLegendItem( datasetIndex, i); if (item != null) { result.add(item); } } }
for (int series = 0; series < seriesCount; series++) { Number number = dataset.getValue(series, item); if (number != null) { double value = number.doubleValue(); if (value > 0.0) { total = total + value; } } }

Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/CategoryPlot.java |  | File path: /jfreechart-1.0.10/src/org/jfree/data/general/DatasetUtilities.java
Method name: `LegendItemCollection getLegendItems()` |  | Method name: `Number findMaximumStackedRangeValue(CategoryDataset)`
Number of AST nodes: 6 |  | Number of AST nodes: 6

1

    if (renderer != null) {↵

1

    for (int series = 0; series < seriesCount; series++) {↵

2

                            int seriesCount = dataset.getRowCount();↵

2

                        Number number = dataset.getValue(series, item);↵

3

                            for (int i = 0; i < seriesCount; i++) {↵

3

                        if (number != null) {↵

4

                                LegendItem item = renderer.getLegendItem(↵

4

                            ↵

5

                                        datasetIndex, i);↵

6

        ↵

5

    double value = number.doubleValue();↵

7

                            if (item != null) {↵

6

                            if (value > 0.0) {↵

8

                                    result.add(item);↵

7

                                ↵

9

        ↵

8

    total = total + value;↵

10

                            }↵

9

                            }↵

11

                            }↵

10

                        ↵

12

        ↵

11

    }↵

13

                    }

12

                    }

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.1
Clones location | Clones are in different classes
Number of node comparisons | 1