TimeSeries ts = (TimeSeries) this.data.get(series); TimeSeriesDataItem dp = ts.getDataItem(item); RegularTimePeriod period = dp.getPeriod(); return new Long(getX(period));
OHLCSeries s = (OHLCSeries) this.data.get(series); OHLCItem di = (OHLCItem) s.getDataItem(item); RegularTimePeriod period = di.getPeriod(); return getX(period);
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/time/ohlc/OHLCSeriesCollection.java
Method name: Number getX(int, int) Method name: double getXValue(int, int)
Number of AST nodes: 4 Number of AST nodes: 4
1
TimeSeries ts = (TimeSeries) this.data.get(series);
1
OHLCSeries s = (OHLCSeries) this.data.get(series);
2
        TimeSeriesDataItem dp = ts.getDataItem(item);
2
        OHLCItem di = (OHLCItem) s.getDataItem(item);
3
        RegularTimePeriod period = dp.getPeriod();
3
        RegularTimePeriod period = di.getPeriod();
4
        return new Long(getX(period));
4
        return getX(period);
Summary
Number of common nesting structure subtrees1
Number of refactorable cases0
Number of non-refactorable cases1
Time elapsed for finding largest common nesting structure subtrees (ms)0.0
Clones locationClones are in different classes having the same super class
Number of node comparisons16
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    TimeSeries ts = (TimeSeries)this.data.get(series);
    1
    TimeSeries ts = (TimeSeries)this.data.get(series);
    1
    OHLCSeries s = (OHLCSeries)this.data.get(series);
    Differences
    Expression1Expression2Difference
    org.jfree.data.time.TimeSeriesorg.jfree.data.time.ohlc.OHLCSeriesSUBCLASS_TYPE_MISMATCH
    tssVARIABLE_NAME_MISMATCH
    org.jfree.data.time.TimeSeriesorg.jfree.data.time.ohlc.OHLCSeriesSUBCLASS_TYPE_MISMATCH
    org.jfree.data.time.TimeSeriesorg.jfree.data.time.ohlc.OHLCSeriesSUBCLASS_TYPE_MISMATCH
    1
    OHLCSeries s = (OHLCSeries)this.data.get(series);
                                                                                              
    2
    OHLCItem di = (OHLCItem)s.getDataItem(item);
    Preondition Violations
    Unmatched statement OHLCItem di=(OHLCItem)s.getDataItem(item); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2
    OHLCItem di = (OHLCItem)s.getDataItem(item);
    2
    TimeSeriesDataItem dp = ts.getDataItem(item);
    2
    TimeSeriesDataItem dp = ts.getDataItem(item);
    Preondition Violations
    Unmatched statement TimeSeriesDataItem dp=ts.getDataItem(item); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                                
    3
    RegularTimePeriod period = dp.getPeriod();
    3
    RegularTimePeriod period = dp.getPeriod();
    3
    RegularTimePeriod period = di.getPeriod();
    Differences
    Expression1Expression2Difference
    dpdiVARIABLE_NAME_MISMATCH
    org.jfree.data.time.TimeSeriesDataItemorg.jfree.data.time.ohlc.OHLCItemVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jfree.data.time.TimeSeriesDataItem of variable dp does not match with type org.jfree.data.time.ohlc.OHLCItem of variable di
    • Make classes org.jfree.data.time.TimeSeriesDataItem and org.jfree.data.time.ohlc.OHLCItem extend a common superclass
    3
    RegularTimePeriod period = di.getPeriod();
                                                  
    4
    return getX(period);
    Preondition Violations
    Unmatched statement return getX(period); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    Unmatched return getX(period);
    4
    return getX(period);
    4
    return new Long(getX(period));
    4
    return new Long(getX(period));
    Preondition Violations
    Unmatched statement return new Long(getX(period)); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    Unmatched return new Long(getX(period));
                                                                      
    Precondition Violations (7)
    Row Violation
    1Unmatched statement OHLCItem di=(OHLCItem)s.getDataItem(item); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Unmatched statement TimeSeriesDataItem dp=ts.getDataItem(item); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3Type org.jfree.data.time.TimeSeriesDataItem of variable dp does not match with type org.jfree.data.time.ohlc.OHLCItem of variable di
    4Unmatched statement return getX(period); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    5Unmatched return getX(period);
    6Unmatched statement return new Long(getX(period)); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    7Unmatched return new Long(getX(period));