1785-1-3

TimeSeries s = (TimeSeries) this.data.get(series); TimeSeriesDataItem i = s.getDataItem(item); RegularTimePeriod period = i.getPeriod(); return getX(period);
XIntervalSeries s = (XIntervalSeries) this.data.get(series); XIntervalDataItem di = (XIntervalDataItem) s.getDataItem(item); return new Double(di.getYValue());

Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/data/time/TimeSeriesCollection.java |  | File path: /jfreechart-1.0.10/src/org/jfree/data/xy/XIntervalSeriesCollection.java
Method name: `double getXValue(int, int)` |  | Method name: `Number getY(int, int)`
Number of AST nodes: 4 |  | Number of AST nodes: 3

1

    TimeSeries s = (TimeSeries) this.data.get(series);↵

1

    XIntervalSeries s = (XIntervalSeries) this.data.get(series);↵

2

            TimeSeriesDataItem i = s.getDataItem(item);↵

2

            XIntervalDataItem di = (XIntervalDataItem) s.getDataItem(item);↵

3

            RegularTimePeriod period = i.getPeriod();↵

3

            ↵

4

            return getX(period);

4

    return new Double(di.getYValue());

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.0
Clones location | Clones are in different classes having the same super class
Number of node comparisons | 12

1. {Non-refactorable}

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

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

   1

       TimeSeries s = (TimeSeries)this.data.get(series);

   1 | TimeSeries s = (TimeSeries)this.data.get(series);
   1 | XIntervalSeries s = (XIntervalSeries)this.data.get(series);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.data.time.TimeSeries | org.jfree.data.xy.XIntervalSeries | SUBCLASS_TYPE_MISMATCH
   org.jfree.data.time.TimeSeries | org.jfree.data.xy.XIntervalSeries | SUBCLASS_TYPE_MISMATCH
   org.jfree.data.time.TimeSeries | org.jfree.data.xy.XIntervalSeries | SUBCLASS_TYPE_MISMATCH

   1

       XIntervalSeries s = (XIntervalSeries)this.data.get(series);

   2

       XIntervalDataItem di = (XIntervalDataItem)s.getDataItem(item);

   2

       TimeSeriesDataItem i = s.getDataItem(item);

   3 | return new Double(di.getYValue());

   Preondition Violations
   Unmatched return new Double(di.getYValue());

   3

       return new Double(di.getYValue());

   3

       RegularTimePeriod period = i.getPeriod();

   4

       return getX(period);

   4 | return getX(period);

   Preondition Violations
   Unmatched return getX(period);

   Precondition Violations (3)
   Row | Violation
   --- | ---
   1 | Unmatched return new Double(di.getYValue());
   2 | Unmatched return getX(period);
   3 | Clone fragment #1 returns variable s with type org.jfree.data.time.TimeSeries , while Clone fragment #2 returns variable s with type org.jfree.data.xy.XIntervalSeries