236-2-3

if (dataset == null) { throw new IllegalArgumentException("Null 'dataset' argument."); } Range result = null; if (dataset instanceof RangeInfo) { RangeInfo info = (RangeInfo) dataset; result = info.getRangeBounds(includeInterval); } else { result = iterateRangeBounds(dataset, includeInterval); } return result;
if (dataset == null) { throw new IllegalArgumentException("Null 'dataset' argument."); } Range result = null; if (dataset instanceof RangeInfo) { RangeInfo info = (RangeInfo) dataset; result = info.getRangeBounds(includeInterval); } else { result = iterateRangeBounds(dataset, includeInterval); } return result;

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: `Range findRangeBounds(CategoryDataset, boolean)` |  | Method name: `Range findRangeBounds(XYDataset, boolean)`
Number of AST nodes: 8 |  | Number of AST nodes: 8

1

    if (dataset == null) {↵

1

    if (dataset == null) {↵

2

                throw new IllegalArgumentException("Null 'dataset' argument.");↵

2

                throw new IllegalArgumentException("Null 'dataset' argument.");↵

3

            }↵

3

            }↵

4

            Range result = null;↵

4

            Range result = null;↵

5

            if (dataset instanceof RangeInfo) {↵

5

            if (dataset instanceof RangeInfo) {↵

6

                RangeInfo info = (RangeInfo) dataset;↵

6

                RangeInfo info = (RangeInfo) dataset;↵

7

                result = info.getRangeBounds(includeInterval);↵

7

                result = info.getRangeBounds(includeInterval);↵

8

            }↵

8

            }↵

9

            else {↵

9

            else {↵

10

                result = iterateRangeBounds(dataset, includeInterval);↵

10

                result = iterateRangeBounds(dataset, includeInterval);↵

11

            }↵

11

            }↵

12

            return result;

12

            return result;

See real code fragment |  | See real code fragment

Summary
Number of common nesting structure subtrees | 1
Number of refactorable cases | 0
Number of non-refactorable cases | 1
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 | 7

1. {Non-refactorable}

   Mapping Summary
   Number of mapped statements | 2
   Number of unmapped statements in the first code fragment | 0
   Number of unmapped statements in the second code fragment | 0
   Time elapsed for statement mapping (ms) | 0.2
   Clone type | Type 2

   Mapped Statements
   ID | Statement |  | ID | Statement
   --- | --- | --- | --- | ---

   1

       if (dataset == null)

   1 | if (dataset == null)
   1 | if (dataset == null)

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.data.category.CategoryDataset | org.jfree.data.xy.XYDataset | VARIABLE_TYPE_MISMATCH

   Preondition Violations

   Type org.jfree.data.category.CategoryDataset of variable dataset does not match with type org.jfree.data.xy.XYDataset of variable dataset
   - Make classes org.jfree.data.category.CategoryDataset and org.jfree.data.xy.XYDataset extend a common superclass

   1

       if (dataset == null)

   2

       throw new IllegalArgumentException("Null 'dataset' argument.");

   2

       throw new IllegalArgumentException("Null 'dataset' argument.");

   Precondition Violations (1)
   Row | Violation
   --- | ---
   1 | Type org.jfree.data.category.CategoryDataset of variable dataset does not match with type org.jfree.data.xy.XYDataset of variable dataset