1542-2-3

DatasetInfo di = getDatasetInfo(series); if (di.data instanceof IntervalXYDataset) { return ((IntervalXYDataset) di.data).getEndX(di.series, item); } else { return getX(series, item); }
DatasetInfo di = getDatasetInfo(series); if (di.data instanceof IntervalXYDataset) { return ((IntervalXYDataset) di.data).getStartY(di.series, item); } else { return getY(series, item); }

Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/data/general/CombinedDataset.java |  | File path: /jfreechart-1.0.10/src/org/jfree/data/general/CombinedDataset.java
Method name: `Number getEndX(int, int)` |  | Method name: `Number getStartY(int, int)`
Number of AST nodes: 4 |  | Number of AST nodes: 4

1

    DatasetInfo di = getDatasetInfo(series);↵

1

    DatasetInfo di = getDatasetInfo(series);↵

2

            if (di.data instanceof IntervalXYDataset) {↵

2

            if (di.data instanceof IntervalXYDataset) {↵

3

                return ((IntervalXYDataset) di.data).getEndX(di.series, item);↵

3

                return ((IntervalXYDataset) di.data).getStartY(di.series, item);↵

4

            }↵

4

            }↵

5

            else {↵

5

            else {↵

6

                return getX(series, item);↵

6

                return getY(series, item);↵

7

            }

7

            }

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 | 10

1. {Non-refactorable}

   Mapping Summary
   Number of mapped statements | 4
   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) | 635.4
   Clone type | Type 2

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

   1

       DatasetInfo di = getDatasetInfo(series);

   1

       DatasetInfo di = getDatasetInfo(series);

   2

       if (di.data instanceof IntervalXYDataset)

   2

       if (di.data instanceof IntervalXYDataset)

   3

       return ((IntervalXYDataset)di.data).getEndX(di.series, item);

   3 | return ((IntervalXYDataset)di.data).getEndX(di.series, item);
   3 | return ((IntervalXYDataset)di.data).getStartY(di.series, item);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   getEndX | getStartY | METHOD_INVOCATION_NAME_MISMATCH

   Preondition Violations
   Expression ((IntervalXYDataset)di.data).getEndX(di.series,item) cannot be parameterized, because it has dependencies to/from statements that will be extracted
   Expression ((IntervalXYDataset)di.data).getStartY(di.series,item) cannot be parameterized, because it has dependencies to/from statements that will be extracted

   3

       return ((IntervalXYDataset)di.data).getStartY(di.series, item);

       else

       else

   4

       return getX(series, item);

   4 | return getX(series, item);
   4 | return getY(series, item);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   getX | getY | METHOD_INVOCATION_NAME_MISMATCH

   4

       return getY(series, item);

   Precondition Violations (2)
   Row | Violation
   --- | ---
   1 | Expression ((IntervalXYDataset)di.data).getEndX(di.series,item) cannot be parameterized, because it has dependencies to/from statements that will be extracted
   2 | Expression ((IntervalXYDataset)di.data).getStartY(di.series,item) cannot be parameterized, because it has dependencies to/from statements that will be extracted