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);
if (obj == this) { return true; } if (!(obj instanceof GanttRenderer)) { return false; } GanttRenderer that = (GanttRenderer) obj; if (!PaintUtilities.equal(this.completePaint, that.completePaint)) { return false; } if (!PaintUtilities.equal(this.incompletePaint, that.incompletePaint)) { return false; } if (this.startPercent != that.startPercent) { return false; } if (this.endPercent != that.endPercent) { 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/StandardDialFrame.java File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/category/GanttRenderer.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 StandardDialFrame)) {
4
        if (!(obj instanceof GanttRenderer)) {
5
            return false;
5
            return false;
6
        }
6
        }
7
        StandardDialFrame that = (StandardDialFrame) obj;
7
        GanttRenderer that = (GanttRenderer) obj;
8
        if (!PaintUtilities.equal(this.backgroundPaint, that.backgroundPaint)) {
8
        if (!PaintUtilities.equal(this.completePaint, that.completePaint)) {
9
            return false;
9
            return false;
10
        }
10
        }
11
        if (!PaintUtilities.equal(this.foregroundPaint, that.foregroundPaint)) {
11
        if (!PaintUtilities.equal(this.incompletePaint, that.incompletePaint)) {
12
            return false;
12
            return false;
13
        }
13
        }
14
        if (this.radius != that.radius) {
14
        if (this.startPercent != that.startPercent) {
15
            return false;
15
            return false;
16
        }
16
        }
17
        if (!this.stroke.equals(that.stroke)) {
17
        if (this.endPercent != that.endPercent) {
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.4
Clones locationClones are in different classes
Number of node comparisons61
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements11
    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.4
    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 StandardDialFrame))
    3
    if (!(obj instanceof StandardDialFrame))
    3
    if (!(obj instanceof GanttRenderer))
    Differences
    Expression1Expression2Difference
    org.jfree.chart.plot.dial.StandardDialFrameorg.jfree.chart.renderer.category.GanttRendererSUBCLASS_TYPE_MISMATCH
    3
    if (!(obj instanceof GanttRenderer))
    4
    return false;
    4
    return false;
    5
    StandardDialFrame that = (StandardDialFrame)obj;
    5
    StandardDialFrame that = (StandardDialFrame)obj;
    5
    GanttRenderer that = (GanttRenderer)obj;
    Differences
    Expression1Expression2Difference
    org.jfree.chart.plot.dial.StandardDialFrameorg.jfree.chart.renderer.category.GanttRendererSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.plot.dial.StandardDialFrameorg.jfree.chart.renderer.category.GanttRendererSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.plot.dial.StandardDialFrameorg.jfree.chart.renderer.category.GanttRendererSUBCLASS_TYPE_MISMATCH
    5
    GanttRenderer that = (GanttRenderer)obj;
    6
    if (!PaintUtilities.equal(this.backgroundPaint, that.backgroundPaint))
    6
    if (!PaintUtilities.equal(this.backgroundPaint, that.backgroundPaint))
    6
    if (!PaintUtilities.equal(this.completePaint, that.completePaint))
    Differences
    Expression1Expression2Difference
    backgroundPaintcompletePaintVARIABLE_NAME_MISMATCH
    org.jfree.chart.plot.dial.StandardDialFrameorg.jfree.chart.renderer.category.GanttRendererSUBCLASS_TYPE_MISMATCH
    backgroundPaintcompletePaintVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression that.backgroundPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.completePaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6
    if (!PaintUtilities.equal(this.completePaint, that.completePaint))
    7
    return false;
    7
    return false;
    8
    if (!PaintUtilities.equal(this.foregroundPaint, that.foregroundPaint))
    8
    if (!PaintUtilities.equal(this.foregroundPaint, that.foregroundPaint))
    8
    if (!PaintUtilities.equal(this.incompletePaint, that.incompletePaint))
    Differences
    Expression1Expression2Difference
    foregroundPaintincompletePaintVARIABLE_NAME_MISMATCH
    org.jfree.chart.plot.dial.StandardDialFrameorg.jfree.chart.renderer.category.GanttRendererSUBCLASS_TYPE_MISMATCH
    foregroundPaintincompletePaintVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression that.foregroundPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.incompletePaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8
    if (!PaintUtilities.equal(this.incompletePaint, that.incompletePaint))
    9
    return false;
    9
    return false;
    10
    if (this.radius != that.radius)
    10
    if (this.radius != that.radius)
    10
    if (this.startPercent != that.startPercent)
    Differences
    Expression1Expression2Difference
    radiusstartPercentVARIABLE_NAME_MISMATCH
    org.jfree.chart.plot.dial.StandardDialFrameorg.jfree.chart.renderer.category.GanttRendererSUBCLASS_TYPE_MISMATCH
    radiusstartPercentVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression that.radius cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.startPercent cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10
    if (this.startPercent != that.startPercent)
    11
    return false;
    11
    return false;
    Precondition Violations (9)
    Row Violation
    1Expression that.backgroundPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression that.completePaint 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.incompletePaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression that.radius cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression that.startPercent cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Clone fragment #1 returns variable that with type org.jfree.chart.plot.dial.StandardDialFrame , while Clone fragment #2 returns variable that with type org.jfree.chart.renderer.category.GanttRenderer
    8Not all possible execution flows end in a return statement
    9The refactoring of the clones is infeasible, because classes org.jfree.chart.plot.dial.StandardDialFrame and org.jfree.chart.renderer.category.GanttRenderer do not have a common superclass