1407-1-2

if (this.parent instanceof IntervalXYDataset) { return ((IntervalXYDataset) this.parent).getStartX( this.map[series], item ); } else { return getX(series, item); }
if (this.parent instanceof IntervalXYDataset) { return ((IntervalXYDataset) this.parent).getEndX( this.map[series], item ); } else { return getX(series, item); }

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

1

    if (this.parent instanceof IntervalXYDataset) {↵

1

    if (this.parent instanceof IntervalXYDataset) {↵

2

                return ((IntervalXYDataset) this.parent).getStartX(↵

2

                return ((IntervalXYDataset) this.parent).getEndX(↵

3

                    this.map[series], item↵

3

                    this.map[series], item↵

4

                );↵

4

                );↵

5

            }↵

5

            }↵

6

            else {↵

6

            else {↵

7

                return getX(series, item);↵

7

                return getX(series, item);↵

8

            }

8

            }

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

1. {Non-refactorable}

   Mapping Summary
   Number of mapped statements | 3
   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.7
   Clone type | Type 2

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

   1

       if (this.parent instanceof IntervalXYDataset)

   1

       if (this.parent instanceof IntervalXYDataset)

   2

       return ((IntervalXYDataset)this.parent).getStartX(this.map[series], item);

   2 | return ((IntervalXYDataset)this.parent).getStartX(this.map[series], item);
   2 | return ((IntervalXYDataset)this.parent).getEndX(this.map[series], item);

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

   Preondition Violations
   Expression ((IntervalXYDataset)this.parent).getStartX(this.map[series],item) cannot be parameterized, because it has dependencies to/from statements that will be extracted
   Expression ((IntervalXYDataset)this.parent).getEndX(this.map[series],item) cannot be parameterized, because it has dependencies to/from statements that will be extracted

   2

       return ((IntervalXYDataset)this.parent).getEndX(this.map[series], item);

       else

       else

   3

       return getX(series, item);

   3

       return getX(series, item);

   Precondition Violations (2)
   Row | Violation
   --- | ---
   1 | Expression ((IntervalXYDataset)this.parent).getStartX(this.map[series],item) cannot be parameterized, because it has dependencies to/from statements that will be extracted
   2 | Expression ((IntervalXYDataset)this.parent).getEndX(this.map[series],item) cannot be parameterized, because it has dependencies to/from statements that will be extracted