if (obj == this) { return true; } if (!(obj instanceof TimePeriodValuesCollection)) { return false; } TimePeriodValuesCollection that = (TimePeriodValuesCollection) obj; if (this.domainIsPointsInTime != that.domainIsPointsInTime) { return false; } if (this.xPosition != that.xPosition) { return false; } if (!ObjectUtilities.equal(this.data, that.data)) { return false; } return true;
if (obj == this) { return true; } if (!(obj instanceof TimeSeriesCollection)) { return false; } TimeSeriesCollection that = (TimeSeriesCollection) obj; if (this.xPosition != that.xPosition) { return false; } if (this.domainIsPointsInTime != that.domainIsPointsInTime) { return false; } if (!ObjectUtilities.equal(this.data, that.data)) { return false; } return true;
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/data/time/TimePeriodValuesCollection.java File path: /jfreechart-1.0.10/src/org/jfree/data/time/TimeSeriesCollection.java
Method name: boolean equals(Object) Method name: boolean equals(Object)
Number of AST nodes: 12 Number of AST nodes: 12
1
if (obj == this) {
1
if (obj == this) {
2
            return true;
2
            return true;
3
        }
3
        }
4
        if (!(obj instanceof TimePeriodValuesCollection)) {
4
        if (!(obj instanceof TimeSeriesCollection)) {
5
            return false;   
5
            return false;
6
        }
6
        }
7
        TimePeriodValuesCollection that = (TimePeriodValuesCollection) obj;
7
        TimeSeriesCollection that = (TimeSeriesCollection) obj;
8
        if (this.domainIsPointsInTime != that.domainIsPointsInTime) {
8
        if (this.xPosition != that.xPosition) {
9
            return false;   
9
            return false;
10
        }
10
        }
11
        if (this.xPosition != that.xPosition) {
11
        if (this.domainIsPointsInTime != that.domainIsPointsInTime) {
12
            return false;   
12
            return false;
13
        }
13
        }
14
        if (!ObjectUtilities.equal(this.data, that.data)) {
14
        if (!ObjectUtilities.equal(this.data, that.data)) {
15
            return false;
15
            return false;
16
        }
16
        }
17
        return true;
17
        return true;
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)4.9
Clones locationClones are in different classes having the same super class
Number of node comparisons50
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements12
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)7.2
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (obj == this)
    1
    if (obj == this)
    2
    return true;
    2
    return true;
    3
    if (!(obj instanceof TimePeriodValuesCollection))
    3
    if (!(obj instanceof TimePeriodValuesCollection))
    3
    if (!(obj instanceof TimeSeriesCollection))
    Differences
    Expression1Expression2Difference
    org.jfree.data.time.TimePeriodValuesCollectionorg.jfree.data.time.TimeSeriesCollectionSUBCLASS_TYPE_MISMATCH
    3
    if (!(obj instanceof TimeSeriesCollection))
    4
    return false;
    4
    return false;
    5
    TimePeriodValuesCollection that = (TimePeriodValuesCollection)obj;
    5
    TimePeriodValuesCollection that = (TimePeriodValuesCollection)obj;
    5
    TimeSeriesCollection that = (TimeSeriesCollection)obj;
    Differences
    Expression1Expression2Difference
    org.jfree.data.time.TimePeriodValuesCollectionorg.jfree.data.time.TimeSeriesCollectionSUBCLASS_TYPE_MISMATCH
    org.jfree.data.time.TimePeriodValuesCollectionorg.jfree.data.time.TimeSeriesCollectionSUBCLASS_TYPE_MISMATCH
    org.jfree.data.time.TimePeriodValuesCollectionorg.jfree.data.time.TimeSeriesCollectionSUBCLASS_TYPE_MISMATCH
    5
    TimeSeriesCollection that = (TimeSeriesCollection)obj;
    6
    if (this.domainIsPointsInTime != that.domainIsPointsInTime)
    6
    if (this.domainIsPointsInTime != that.domainIsPointsInTime)
    8
    if (this.domainIsPointsInTime != that.domainIsPointsInTime)
    Differences
    Expression1Expression2Difference
    org.jfree.data.time.TimePeriodValuesCollectionorg.jfree.data.time.TimeSeriesCollectionSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression that.domainIsPointsInTime cannot be unified with expression that.domainIsPointsInTime , because common superclass org.jfree.data.xy.AbstractIntervalXYDataset does not declare member(s) private boolean domainIsPointsInTime
    8
    if (this.domainIsPointsInTime != that.domainIsPointsInTime)
    7
    return false;
    9
    return false;
    8
    if (this.xPosition != that.xPosition)
    8
    if (this.xPosition != that.xPosition)
    6
    if (this.xPosition != that.xPosition)
    Differences
    Expression1Expression2Difference
    org.jfree.data.time.TimePeriodValuesCollectionorg.jfree.data.time.TimeSeriesCollectionSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression that.xPosition cannot be unified with expression that.xPosition , because common superclass org.jfree.data.xy.AbstractIntervalXYDataset does not declare member(s) private org.jfree.data.time.TimePeriodAnchor xPosition
    6
    if (this.xPosition != that.xPosition)
    9
    return false;
    7
    return false;
    10
    if (!ObjectUtilities.equal(this.data, that.data))
    10
    if (!ObjectUtilities.equal(this.data, that.data))
    10
    if (!ObjectUtilities.equal(this.data, that.data))
    Differences
    Expression1Expression2Difference
    org.jfree.data.time.TimePeriodValuesCollectionorg.jfree.data.time.TimeSeriesCollectionSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression that.data cannot be unified with expression that.data , because common superclass org.jfree.data.xy.AbstractIntervalXYDataset does not declare member(s) private List#RAW data
    10
    if (!ObjectUtilities.equal(this.data, that.data))
    11
    return false;
    11
    return false;
    12
    return true;
    12
    return true;
    Precondition Violations (3)
    Row Violation
    1Expression that.domainIsPointsInTime cannot be unified with expression that.domainIsPointsInTime , because common superclass org.jfree.data.xy.AbstractIntervalXYDataset does not declare member(s) private boolean domainIsPointsInTime
    2Expression that.xPosition cannot be unified with expression that.xPosition , because common superclass org.jfree.data.xy.AbstractIntervalXYDataset does not declare member(s) private org.jfree.data.time.TimePeriodAnchor xPosition
    3Expression that.data cannot be unified with expression that.data , because common superclass org.jfree.data.xy.AbstractIntervalXYDataset does not declare member(s) private List#RAW data