240-1-4

if (dataset instanceof DomainInfo) { DomainInfo info = (DomainInfo) dataset; return new Double(info.getDomainLowerBound(true)); } else { double minimum = Double.POSITIVE_INFINITY; int seriesCount = dataset.getSeriesCount(); for (int series = 0; series < seriesCount; series++) { int itemCount = dataset.getItemCount(series); for (int item = 0; item < itemCount; item++) { double value; if (dataset instanceof IntervalXYDataset) { IntervalXYDataset intervalXYData = (IntervalXYDataset) dataset; value = intervalXYData.getStartXValue(series, item); } else { value = dataset.getXValue(series, item); } if (!Double.isNaN(value)) { minimum = Math.min(minimum, value); } } } if (minimum == Double.POSITIVE_INFINITY) { result = null; } else { result = new Double(minimum); } }
double maximum = Double.NEGATIVE_INFINITY; int seriesCount = dataset.getSeriesCount(); for (int series = 0; series < seriesCount; series++) { int itemCount = dataset.getItemCount(series); for (int item = 0; item < itemCount; item++) { double value; if (dataset instanceof IntervalXYDataset) { IntervalXYDataset intervalXYData = (IntervalXYDataset) dataset; value = intervalXYData.getEndYValue(series, item); } else if (dataset instanceof OHLCDataset) { OHLCDataset highLowData = (OHLCDataset) dataset; value = highLowData.getHighValue(series, item); } else { value = dataset.getYValue(series, item); } if (!Double.isNaN(value)) { maximum = Math.max(maximum, value); } } } if (maximum == Double.NEGATIVE_INFINITY) { return null; } else { return new Double(maximum); }

Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/data/general/DatasetUtilities.java |  | File path: /jfreechart-1.0.10/src/org/jfree/data/general/DatasetUtilities.java
Method name: `Number findMinimumDomainValue(XYDataset)` |  | Method name: `Number findMaximumRangeValue(XYDataset)`
Number of AST nodes: 18 |  | Number of AST nodes: 18

1

    if (dataset instanceof DomainInfo) {↵

2

                DomainInfo info = (DomainInfo) dataset;↵

3

                return new Double(info.getDomainLowerBound(true));↵

4

            }↵

5

            else {↵

6

                double minimum = Double.POSITIVE_INFINITY;↵

1

    double maximum = Double.NEGATIVE_INFINITY;↵

7

                int seriesCount = dataset.getSeriesCount();↵

2

                int seriesCount = dataset.getSeriesCount();↵

8

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

3

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

9

                    int itemCount = dataset.getItemCount(series);↵

4

                    int itemCount = dataset.getItemCount(series);↵

10

                    for (int item = 0; item < itemCount; item++) {↵

5

                    for (int item = 0; item < itemCount; item++) {↵

11

                        double value;↵

6

                        double value;↵

12

                        if (dataset instanceof IntervalXYDataset) {↵

7

                        if (dataset instanceof IntervalXYDataset) {↵

13

                            IntervalXYDataset intervalXYData↵

8

                            IntervalXYDataset intervalXYData↵

14

                                = (IntervalXYDataset) dataset;↵

9

                                = (IntervalXYDataset) dataset;↵

15

                            value = intervalXYData.getStartX↵

10

                            value = intervalXYData.getEndYValue(series, item);↵

11

                        }↵

12

                        else if (dataset instanceof OHLCDataset) {↵

13

                            OHLCDataset highLowData = (OHLCDataset) dataset;↵

16

    Value(series, item);↵

14

                            value = highLowData.getHighValue(series, item);↵

17

                        }↵

15

                        }↵

18

                        else {↵

16

                        else {↵

19

                            value = dataset.getXValue(series, item);↵

17

                            value = dataset.getYValue(series, item);↵

20

                        }↵

18

                        }↵

21

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

19

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

22

                            minimum = Math.min(minimum, value);↵

20

                            maximum = Math.max(maximum, value);↵

23

                        }↵

21

                        }↵

24

                    }↵

22

                    }↵

25

                }↵

23

                }↵

26

                if (minimum == Double.POSITIVE_INFINITY) {↵

24

                if (maximum == Double.NEGATIVE_INFINITY) {↵

27

                    result = null;↵

25

                    return null;↵

28

                }↵

26

                }↵

29

                else {↵

27

                else {↵

30

                    result = new Double(minimum);↵

28

                    return new Double(maximum);↵

31

                }↵

29

                }

32

            }

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.2
Clones location | Clones are declared in the same class
Number of node comparisons | 6