301-1-2

if (values == null || values.length < 1) { throw new IllegalArgumentException( "Null or zero length 'values' argument."); } double max = -Double.MAX_VALUE; for (int i = 0; i < values.length; i++) { if (values[i] > max) { max = values[i]; } } return max;
if (values == null || values.length < 1) { throw new IllegalArgumentException( "Null or zero length 'values' argument."); } double min = Double.MAX_VALUE; for (int i = 0; i < values.length; i++) { if (values[i] < min) { min = values[i]; } } return min;

Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/data/statistics/HistogramDataset.java |  | File path: /jfreechart-1.0.10/src/org/jfree/data/statistics/HistogramDataset.java
Method name: `double getMaximum(double[])` |  | Method name: `double getMinimum(double[])`
Number of AST nodes: 7 |  | Number of AST nodes: 7

1

    if (values == null || values.length < 1) {↵

1

    if (values == null || values.length < 1) {↵

2

                throw new IllegalArgumentException(↵

2

                throw new IllegalArgumentException(↵

3

                        "Null or zero length 'values' argument.");↵

3

                        "Null or zero length 'values' argument.");↵

4

            }↵

4

            }↵

5

            double max = -Double.MAX_VALUE;↵

5

            double min = Double.MAX_VALUE;↵

6

            for (int i = 0; i < values.length; i++) {↵

6

            for (int i = 0; i < values.length; i++) {↵

7

                if (values[i] &gt; max) {↵

7

                if (values[i] &lt; min) {↵

8

                    max = values[i];↵

8

                    min = values[i];↵

9

                }↵

9

                }↵

10

            }↵

10

            }↵

11

            return max;

11

            return min;

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 declared in the same class
Number of node comparisons | 1