1118-1-3

double total = 0.0; int rowCount = data.getRowCount(); for (int r = 0; r < rowCount; r++) { Number n = data.getValue(r, column); if (n != null) { total += n.doubleValue(); } } return total;
double total = 0.0; int seriesCount = dataset.getSeriesCount(); for (int s = 0; s < seriesCount; s++) { double value = dataset.getYValue(s, item); if (!Double.isNaN(value)) { total = total + value; } } return total;

Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/data/DataUtilities.java |  | File path: /jfreechart-1.0.10/src/org/jfree/data/general/DatasetUtilities.java
Method name: `double calculateColumnTotal(Values2D, int)` |  | Method name: `double calculateStackTotal(TableXYDataset, int)`
Number of AST nodes: 7 |  | Number of AST nodes: 7

1

    double total = 0.0;↵

1

    double total = 0.0;↵

2

            int rowCount = data.getRowCount();↵

2

            int seriesCount = dataset.getSeriesCount();↵

3

            for (int r = 0; r < rowCount; r++) {↵

3

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

4

                Number n = data.getValue(r, column);↵

4

                double value = dataset.getYValue(s, item);↵

5

                if (n != null) {↵

5

                if (!Double.isNaN(value)) {↵

6

                    total += n.doubleValue();   ↵

6

                    total = total + value;↵

7

                }↵

7

                }↵

8

            }↵

8

            }↵

9

            return total;

9

            return total;

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