if (obj == this) { return true; } if (!(obj instanceof DialCap)) { return false; } DialCap that = (DialCap) obj; if (this.radius != that.radius) { return false; } if (!PaintUtilities.equal(this.fillPaint, that.fillPaint)) { return false; } if (!PaintUtilities.equal(this.outlinePaint, that.outlinePaint)) { return false; } if (!this.outlineStroke.equals(that.outlineStroke)) { return false; } return super.equals(obj);
if (obj == this) { return true; } if (!(obj instanceof StandardDialFrame)) { return false; } StandardDialFrame that = (StandardDialFrame) obj; if (!PaintUtilities.equal(this.backgroundPaint, that.backgroundPaint)) { return false; } if (!PaintUtilities.equal(this.foregroundPaint, that.foregroundPaint)) { return false; } if (this.radius != that.radius) { return false; } if (!this.stroke.equals(that.stroke)) { return false; } return super.equals(obj);
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/dial/DialCap.java File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/dial/StandardDialFrame.java
Method name: boolean equals(Object) Method name: boolean equals(Object)
Number of AST nodes: 14 Number of AST nodes: 14
1
if (obj == this) {
1
if (obj == this) {
2
            return true;
2
            return true;
3
        }
3
        }
4
        if (!(obj instanceof DialCap)) {
4
        if (!(obj instanceof StandardDialFrame)) {
5
            return false;
5
            return false;
6
        }
6
        }
7
        DialCap that = (DialCap) obj;
7
        StandardDialFrame that = (StandardDialFrame) obj;
8
        if (this.radius != that.radius) {
8
        if (!PaintUtilities.equal(this.backgroundPaint, that.backgroundPaint)) {
9
            return false;
9
            return false;
10
        }
10
        }
11
        if (!PaintUtilities.equal(this.fillPaint, that.fillPaint)) {
11
        if (!PaintUtilities.equal(this.foregroundPaint, that.foregroundPaint)) {
12
            return false;
12
            return false;
13
        }
13
        }
14
        if (!PaintUtilities.equal(this.outlinePaint, that.outlinePaint)) {
14
        if (this.radius != that.radius) {
15
            return false;
15
            return false;
16
        }
16
        }
17
        if (!this.outlineStroke.equals(that.outlineStroke)) {
17
        if (!this.stroke.equals(that.stroke)) {
18
            return false;
18
            return false;
19
        }
19
        }
20
        return super.equals(obj);
20
        return super.equals(obj);
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 comparisons76
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements14
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)5.6
    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 DialCap))
    3
    if (!(obj instanceof DialCap))
    3
    if (!(obj instanceof StandardDialFrame))
    Differences
    Expression1Expression2Difference
    org.jfree.chart.plot.dial.DialCaporg.jfree.chart.plot.dial.StandardDialFrameSUBCLASS_TYPE_MISMATCH
    3
    if (!(obj instanceof StandardDialFrame))
    4
    return false;
    4
    return false;
    5
    DialCap that = (DialCap)obj;
    5
    DialCap that = (DialCap)obj;
    5
    StandardDialFrame that = (StandardDialFrame)obj;
    Differences
    Expression1Expression2Difference
    org.jfree.chart.plot.dial.DialCaporg.jfree.chart.plot.dial.StandardDialFrameSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.plot.dial.DialCaporg.jfree.chart.plot.dial.StandardDialFrameSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.plot.dial.DialCaporg.jfree.chart.plot.dial.StandardDialFrameSUBCLASS_TYPE_MISMATCH
    5
    StandardDialFrame that = (StandardDialFrame)obj;
    6
    if (this.radius != that.radius)
    6
    if (this.radius != that.radius)
    10
    if (this.radius != that.radius)
    Differences
    Expression1Expression2Difference
    org.jfree.chart.plot.dial.DialCaporg.jfree.chart.plot.dial.StandardDialFrameSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression that.radius cannot be unified with expression that.radius , because common superclass org.jfree.chart.plot.dial.AbstractDialLayer does not declare member(s) private double radius
    10
    if (this.radius != that.radius)
    7
    return false;
    11
    return false;
    8
    if (!PaintUtilities.equal(this.fillPaint, that.fillPaint))
    8
    if (!PaintUtilities.equal(this.fillPaint, that.fillPaint))
    8
    if (!PaintUtilities.equal(this.foregroundPaint, that.foregroundPaint))
    Differences
    Expression1Expression2Difference
    fillPaintforegroundPaintVARIABLE_NAME_MISMATCH
    org.jfree.chart.plot.dial.DialCaporg.jfree.chart.plot.dial.StandardDialFrameSUBCLASS_TYPE_MISMATCH
    fillPaintforegroundPaintVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression that.fillPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.foregroundPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8
    if (!PaintUtilities.equal(this.foregroundPaint, that.foregroundPaint))
    9
    return false;
    9
    return false;
    10
    if (!PaintUtilities.equal(this.outlinePaint, that.outlinePaint))
    10
    if (!PaintUtilities.equal(this.outlinePaint, that.outlinePaint))
    6
    if (!PaintUtilities.equal(this.backgroundPaint, that.backgroundPaint))
    Differences
    Expression1Expression2Difference
    outlinePaintbackgroundPaintVARIABLE_NAME_MISMATCH
    org.jfree.chart.plot.dial.DialCaporg.jfree.chart.plot.dial.StandardDialFrameSUBCLASS_TYPE_MISMATCH
    outlinePaintbackgroundPaintVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression that.outlinePaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.backgroundPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6
    if (!PaintUtilities.equal(this.backgroundPaint, that.backgroundPaint))
    11
    return false;
    7
    return false;
    12
    if (!this.outlineStroke.equals(that.outlineStroke))
    12
    if (!this.outlineStroke.equals(that.outlineStroke))
    12
    if (!this.stroke.equals(that.stroke))
    Differences
    Expression1Expression2Difference
    org.jfree.chart.plot.dial.DialCaporg.jfree.chart.plot.dial.StandardDialFrameSUBCLASS_TYPE_MISMATCH
    outlineStrokestrokeVARIABLE_NAME_MISMATCH
    outlineStrokestrokeVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression that.outlineStroke cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.stroke cannot be parameterized, because it has dependencies to/from statements that will be extracted
    12
    if (!this.stroke.equals(that.stroke))
    13
    return false;
    13
    return false;
    14
    return super.equals(obj);
    14
    return super.equals(obj);
    14
    return super.equals(obj);
    Preondition Violations
    Super method call return super.equals(obj); cannot be extracted from method
    Super method call return super.equals(obj); cannot be extracted from method
    14
    return super.equals(obj);
    Precondition Violations (9)
    Row Violation
    1Expression that.radius cannot be unified with expression that.radius , because common superclass org.jfree.chart.plot.dial.AbstractDialLayer does not declare member(s) private double radius
    2Expression that.fillPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression that.foregroundPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression that.outlinePaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression that.backgroundPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression that.outlineStroke cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression that.stroke cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Super method call return super.equals(obj); cannot be extracted from method
    9Super method call return super.equals(obj); cannot be extracted from method