if (obj == this) { return true; } if (!(obj instanceof ComparableObjectSeries)) { return false; } if (!super.equals(obj)) { return false; } ComparableObjectSeries that = (ComparableObjectSeries) obj; if (this.maximumItemCount != that.maximumItemCount) { return false; } if (this.autoSort != that.autoSort) { return false; } if (this.allowDuplicateXValues != that.allowDuplicateXValues) { return false; } if (!ObjectUtilities.equal(this.data, that.data)) { return false; } return true;
if (obj == this) { return true; } if (!(obj instanceof XYSeries)) { return false; } if (!super.equals(obj)) { return false; } XYSeries that = (XYSeries) obj; if (this.maximumItemCount != that.maximumItemCount) { return false; } if (this.autoSort != that.autoSort) { return false; } if (this.allowDuplicateXValues != that.allowDuplicateXValues) { 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/ComparableObjectSeries.java File path: /jfreechart-1.0.10/src/org/jfree/data/xy/XYSeries.java
Method name: boolean equals(Object) Method name: boolean equals(Object)
Number of AST nodes: 16 Number of AST nodes: 16
1
if (obj == this) {
1
if (obj == this) {
2
            return true;
2
            return true;
3
        }
3
        }
4
        if (!(obj instanceof ComparableObjectSeries)) {
4
        if (!(obj instanceof XYSeries)) {
5
            return false;
5
            return false;
6
        }
6
        }
7
        if (!super.equals(obj)) {
7
        if (!super.equals(obj)) {
8
            return false;
8
            return false;
9
        }
9
        }
10
        ComparableObjectSeries that = (ComparableObjectSeries) obj;
10
        XYSeries that = (XYSeries) obj;
11
        if (this.maximumItemCount != that.maximumItemCount) {
11
        if (this.maximumItemCount != that.maximumItemCount) {
12
            return false;
12
            return false;
13
        }
13
        }
14
        if (this.autoSort != that.autoSort) {
14
        if (this.autoSort != that.autoSort) {
15
            return false;
15
            return false;
16
        }
16
        }
17
        if (this.allowDuplicateXValues != that.allowDuplicateXValues) {
17
        if (this.allowDuplicateXValues != that.allowDuplicateXValues) {
18
            return false;
18
            return false;
19
        }
19
        }
20
        if (!ObjectUtilities.equal(this.data, that.data)) {
20
        if (!ObjectUtilities.equal(this.data, that.data)) {
21
            return false;
21
            return false;
22
        }
22
        }
23
        return true;
23
        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)3.1
Clones locationClones are in different classes having the same super class
Number of node comparisons92
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements16
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)4.7
    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 ComparableObjectSeries))
    3
    if (!(obj instanceof ComparableObjectSeries))
    3
    if (!(obj instanceof XYSeries))
    Differences
    Expression1Expression2Difference
    org.jfree.data.ComparableObjectSeriesorg.jfree.data.xy.XYSeriesSUBCLASS_TYPE_MISMATCH
    3
    if (!(obj instanceof XYSeries))
    4
    return false;
    4
    return false;
    5
    if (!super.equals(obj))
    5
    if (!super.equals(obj))
    5
    if (!super.equals(obj))
    Preondition Violations
    Super method call if(!super.equals(obj)) cannot be extracted from method
    Super method call if(!super.equals(obj)) cannot be extracted from method
    5
    if (!super.equals(obj))
    6
    return false;
    6
    return false;
    7
    ComparableObjectSeries that = (ComparableObjectSeries)obj;
    7
    ComparableObjectSeries that = (ComparableObjectSeries)obj;
    7
    XYSeries that = (XYSeries)obj;
    Differences
    Expression1Expression2Difference
    org.jfree.data.ComparableObjectSeriesorg.jfree.data.xy.XYSeriesSUBCLASS_TYPE_MISMATCH
    org.jfree.data.ComparableObjectSeriesorg.jfree.data.xy.XYSeriesSUBCLASS_TYPE_MISMATCH
    org.jfree.data.ComparableObjectSeriesorg.jfree.data.xy.XYSeriesSUBCLASS_TYPE_MISMATCH
    7
    XYSeries that = (XYSeries)obj;
    8
    if (this.maximumItemCount != that.maximumItemCount)
    8
    if (this.maximumItemCount != that.maximumItemCount)
    8
    if (this.maximumItemCount != that.maximumItemCount)
    Differences
    Expression1Expression2Difference
    org.jfree.data.ComparableObjectSeriesorg.jfree.data.xy.XYSeriesSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression that.maximumItemCount cannot be unified with expression that.maximumItemCount , because common superclass org.jfree.data.general.Series does not declare member(s) private int maximumItemCount
    8
    if (this.maximumItemCount != that.maximumItemCount)
    9
    return false;
    9
    return false;
    10
    if (this.autoSort != that.autoSort)
    10
    if (this.autoSort != that.autoSort)
    10
    if (this.autoSort != that.autoSort)
    Differences
    Expression1Expression2Difference
    org.jfree.data.ComparableObjectSeriesorg.jfree.data.xy.XYSeriesSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression that.autoSort cannot be unified with expression that.autoSort , because common superclass org.jfree.data.general.Series does not declare member(s) private boolean autoSort
    10
    if (this.autoSort != that.autoSort)
    11
    return false;
    11
    return false;
    12
    if (this.allowDuplicateXValues != that.allowDuplicateXValues)
    12
    if (this.allowDuplicateXValues != that.allowDuplicateXValues)
    12
    if (this.allowDuplicateXValues != that.allowDuplicateXValues)
    Differences
    Expression1Expression2Difference
    org.jfree.data.ComparableObjectSeriesorg.jfree.data.xy.XYSeriesSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression that.allowDuplicateXValues cannot be unified with expression that.allowDuplicateXValues , because common superclass org.jfree.data.general.Series does not declare member(s) private boolean allowDuplicateXValues
    12
    if (this.allowDuplicateXValues != that.allowDuplicateXValues)
    13
    return false;
    13
    return false;
    14
    if (!ObjectUtilities.equal(this.data, that.data))
    14
    if (!ObjectUtilities.equal(this.data, that.data))
    14
    if (!ObjectUtilities.equal(this.data, that.data))
    Differences
    Expression1Expression2Difference
    org.jfree.data.ComparableObjectSeriesorg.jfree.data.xy.XYSeriesSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression that.data cannot be unified with expression that.data , because common superclass org.jfree.data.general.Series does not declare member(s) protected List#RAW data
    14
    if (!ObjectUtilities.equal(this.data, that.data))
    15
    return false;
    15
    return false;
    16
    return true;
    16
    return true;
    Precondition Violations (6)
    Row Violation
    1Super method call if(!super.equals(obj)) cannot be extracted from method
    2Super method call if(!super.equals(obj)) cannot be extracted from method
    3Expression that.maximumItemCount cannot be unified with expression that.maximumItemCount , because common superclass org.jfree.data.general.Series does not declare member(s) private int maximumItemCount
    4Expression that.autoSort cannot be unified with expression that.autoSort , because common superclass org.jfree.data.general.Series does not declare member(s) private boolean autoSort
    5Expression that.allowDuplicateXValues cannot be unified with expression that.allowDuplicateXValues , because common superclass org.jfree.data.general.Series does not declare member(s) private boolean allowDuplicateXValues
    6Expression that.data cannot be unified with expression that.data , because common superclass org.jfree.data.general.Series does not declare member(s) protected List#RAW data