if (obj == this) { return true; } if (!(obj instanceof ArcDialFrame)) { return false; } ArcDialFrame that = (ArcDialFrame) obj; if (!PaintUtilities.equal(this.backgroundPaint, that.backgroundPaint)) { return false; } if (!PaintUtilities.equal(this.foregroundPaint, that.foregroundPaint)) { return false; } if (this.startAngle != that.startAngle) { return false; } if (this.extent != that.extent) { return false; } if (this.innerRadius != that.innerRadius) { return false; } if (this.outerRadius != that.outerRadius) { return false; } if (!this.stroke.equals(that.stroke)) { return false; } return super.equals(obj);
if (obj == this) { return true; } if (!(obj instanceof ScatterRenderer)) { return false; } ScatterRenderer that = (ScatterRenderer) obj; if (!ObjectUtilities.equal(this.seriesShapesFilled, that.seriesShapesFilled)) { return false; } if (this.baseShapesFilled != that.baseShapesFilled) { return false; } if (this.useFillPaint != that.useFillPaint) { return false; } if (this.drawOutlines != that.drawOutlines) { return false; } if (this.useOutlinePaint != that.useOutlinePaint) { return false; } if (this.useSeriesOffset != that.useSeriesOffset) { return false; } if (this.itemMargin != that.itemMargin) { 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/ArcDialFrame.java File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/category/ScatterRenderer.java
Method name: boolean equals(Object) Method name: boolean equals(Object)
Number of AST nodes: 20 Number of AST nodes: 20
1
if (obj == this) {
1
if (obj == this) {
2
            return true;
2
            return true;
3
        }
3
        }
4
        if (!(obj instanceof ArcDialFrame)) {
4
        if (!(obj instanceof ScatterRenderer)) {
5
            return false;
5
            return false;
6
        }
6
        }
7
        ArcDialFrame that = (ArcDialFrame) obj;
7
        ScatterRenderer that = (ScatterRenderer) obj;
8
        if (!PaintUtilities.equal(this.backgroundPaint, that.backgroundPaint
8
        if (!ObjectUtilities.equal(this.seriesShapesFilled,
9
)) {
9
                that.seriesShapesFilled)) {
10
            return false;
10
            return false;
11
        }
11
        }
12
        if (!PaintUtilities.equal(this.foregroundPaint, that.foregroundPaint)) {
12
        if (this.baseShapesFilled != that.baseShapesFilled) {
13
            return false;
13
            return false;
14
        }
14
        }
15
        if (this.startAngle != that.startAngle) {
15
        if (this.useFillPaint != that.useFillPaint) {
16
            return false;
16
            return false;
17
        }
17
        }
18
        if (this.extent != that.extent) {
18
        if (this.drawOutlines != that.drawOutlines) {
19
            return false;
19
            return false;
20
        }
20
        }
21
        if (this.innerRadius != that.innerRadius) {
21
        if (this.useOutlinePaint != that.useOutlinePaint) {
22
            return false;
22
            return false;
23
        }
23
        }
24
        if (this.outerRadius != that.outerRadius) {
24
        if (this.useSeriesOffset != that.useSeriesOffset) {
25
            return false;
25
            return false;
26
        }
26
        }
27
        if (!this.stroke.equals(that.stroke)) {
27
        if (this.itemMargin != that.itemMargin) {
28
            return false;
28
            return false;
29
        }
29
        }
30
        return super.equals(obj);
30
        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)8.6
Clones locationClones are in different classes
Number of node comparisons124
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements15
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)7.3
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    1
    if (obj == this)
    1
    if (obj == this)
    2
    return true;
    2
    return true;
    3
    if (!(obj instanceof ArcDialFrame))
    3
    if (!(obj instanceof ArcDialFrame))
    3
    if (!(obj instanceof ScatterRenderer))
    Differences
    Expression1Expression2Difference
    org.jfree.chart.plot.dial.ArcDialFrameorg.jfree.chart.renderer.category.ScatterRendererSUBCLASS_TYPE_MISMATCH
    3
    if (!(obj instanceof ScatterRenderer))
    4
    return false;
    4
    return false;
    5
    ArcDialFrame that = (ArcDialFrame)obj;
    5
    ArcDialFrame that = (ArcDialFrame)obj;
    5
    ScatterRenderer that = (ScatterRenderer)obj;
    Differences
    Expression1Expression2Difference
    org.jfree.chart.plot.dial.ArcDialFrameorg.jfree.chart.renderer.category.ScatterRendererSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.plot.dial.ArcDialFrameorg.jfree.chart.renderer.category.ScatterRendererSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.plot.dial.ArcDialFrameorg.jfree.chart.renderer.category.ScatterRendererSUBCLASS_TYPE_MISMATCH
    5
    ScatterRenderer that = (ScatterRenderer)obj;
    6
    if (!PaintUtilities.equal(this.backgroundPaint, that.backgroundPaint))
    6
    if (!PaintUtilities.equal(this.backgroundPaint, that.backgroundPaint))
    6
    if (!ObjectUtilities.equal(this.seriesShapesFilled, that.seriesShapesFilled))
    Differences
    Expression1Expression2Difference
    backgroundPaintseriesShapesFilledVARIABLE_NAME_MISMATCH
    java.awt.Paintorg.jfree.util.BooleanListVARIABLE_TYPE_MISMATCH
    org.jfree.chart.plot.dial.ArcDialFrameorg.jfree.chart.renderer.category.ScatterRendererSUBCLASS_TYPE_MISMATCH
    backgroundPaintseriesShapesFilledVARIABLE_NAME_MISMATCH
    java.awt.Paintorg.jfree.util.BooleanListVARIABLE_TYPE_MISMATCH
    org.jfree.util.PaintUtilitiesorg.jfree.util.ObjectUtilitiesVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.awt.Paint of variable this.backgroundPaint does not match with type org.jfree.util.BooleanList of variable this.seriesShapesFilled
    • Make classes java.awt.Paint and org.jfree.util.BooleanList extend a common superclass
    Expression that.backgroundPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.seriesShapesFilled cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type java.awt.Paint of variable that.backgroundPaint does not match with type org.jfree.util.BooleanList of variable that.seriesShapesFilled
    • Make classes java.awt.Paint and org.jfree.util.BooleanList extend a common superclass
    Type org.jfree.util.PaintUtilities does not match with type org.jfree.util.ObjectUtilities
    • Make classes org.jfree.util.PaintUtilities and org.jfree.util.ObjectUtilities extend a common superclass
    6
    if (!ObjectUtilities.equal(this.seriesShapesFilled, that.seriesShapesFilled))
    7
    return false;
    7
    return false;
    8
    if (!PaintUtilities.equal(this.foregroundPaint, that.foregroundPaint))
    8
    if (!PaintUtilities.equal(this.foregroundPaint, that.foregroundPaint))
    Preondition Violations
    Unmatched statement if(!PaintUtilities.equal(this.foregroundPaint,that.foregroundPaint)) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                                                                                  
    9
    return false;
    9
    return false;
    Preondition Violations
    Unmatched return false;
                                    
    10
    if (this.startAngle != that.startAngle)
    10
    if (this.startAngle != that.startAngle)
    10
    if (this.useFillPaint != that.useFillPaint)
    Differences
    Expression1Expression2Difference
    startAngleuseFillPaintVARIABLE_NAME_MISMATCH
    doublebooleanVARIABLE_TYPE_MISMATCH
    org.jfree.chart.plot.dial.ArcDialFrameorg.jfree.chart.renderer.category.ScatterRendererSUBCLASS_TYPE_MISMATCH
    startAngleuseFillPaintVARIABLE_NAME_MISMATCH
    doublebooleanVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type double of variable this.startAngle does not match with type boolean of variable this.useFillPaint
    Expression that.startAngle cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.useFillPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type double of variable that.startAngle does not match with type boolean of variable that.useFillPaint
    10
    if (this.useFillPaint != that.useFillPaint)
    11
    return false;
    11
    return false;
    12
    if (this.extent != that.extent)
    12
    if (this.extent != that.extent)
    12
    if (this.drawOutlines != that.drawOutlines)
    Differences
    Expression1Expression2Difference
    extentdrawOutlinesVARIABLE_NAME_MISMATCH
    doublebooleanVARIABLE_TYPE_MISMATCH
    org.jfree.chart.plot.dial.ArcDialFrameorg.jfree.chart.renderer.category.ScatterRendererSUBCLASS_TYPE_MISMATCH
    extentdrawOutlinesVARIABLE_NAME_MISMATCH
    doublebooleanVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type double of variable this.extent does not match with type boolean of variable this.drawOutlines
    Expression that.extent cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.drawOutlines cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type double of variable that.extent does not match with type boolean of variable that.drawOutlines
    12
    if (this.drawOutlines != that.drawOutlines)
    13
    return false;
    13
    return false;
    14
    if (this.innerRadius != that.innerRadius)
    14
    if (this.innerRadius != that.innerRadius)
    14
    if (this.useOutlinePaint != that.useOutlinePaint)
    Differences
    Expression1Expression2Difference
    innerRadiususeOutlinePaintVARIABLE_NAME_MISMATCH
    doublebooleanVARIABLE_TYPE_MISMATCH
    org.jfree.chart.plot.dial.ArcDialFrameorg.jfree.chart.renderer.category.ScatterRendererSUBCLASS_TYPE_MISMATCH
    innerRadiususeOutlinePaintVARIABLE_NAME_MISMATCH
    doublebooleanVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type double of variable this.innerRadius does not match with type boolean of variable this.useOutlinePaint
    Expression that.innerRadius cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.useOutlinePaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type double of variable that.innerRadius does not match with type boolean of variable that.useOutlinePaint
    14
    if (this.useOutlinePaint != that.useOutlinePaint)
    15
    return false;
    15
    return false;
    16
    if (this.outerRadius != that.outerRadius)
    16
    if (this.outerRadius != that.outerRadius)
    8
    if (this.baseShapesFilled != that.baseShapesFilled)
    Differences
    Expression1Expression2Difference
    outerRadiusbaseShapesFilledVARIABLE_NAME_MISMATCH
    doublebooleanVARIABLE_TYPE_MISMATCH
    org.jfree.chart.plot.dial.ArcDialFrameorg.jfree.chart.renderer.category.ScatterRendererSUBCLASS_TYPE_MISMATCH
    outerRadiusbaseShapesFilledVARIABLE_NAME_MISMATCH
    doublebooleanVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type double of variable this.outerRadius does not match with type boolean of variable this.baseShapesFilled
    Expression that.outerRadius cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.baseShapesFilled cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type double of variable that.outerRadius does not match with type boolean of variable that.baseShapesFilled
    8
    if (this.baseShapesFilled != that.baseShapesFilled)
    17
    return false;
    9
    return false;
    Precondition Violations (26)
    Row Violation
    1Type java.awt.Paint of variable this.backgroundPaint does not match with type org.jfree.util.BooleanList of variable this.seriesShapesFilled
    2Expression that.backgroundPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression that.seriesShapesFilled cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Type java.awt.Paint of variable that.backgroundPaint does not match with type org.jfree.util.BooleanList of variable that.seriesShapesFilled
    5Type org.jfree.util.PaintUtilities does not match with type org.jfree.util.ObjectUtilities
    6Unmatched statement if(!PaintUtilities.equal(this.foregroundPaint,that.foregroundPaint)) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    7Unmatched return false;
    8Type double of variable this.startAngle does not match with type boolean of variable this.useFillPaint
    9Expression that.startAngle cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10Expression that.useFillPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    11Type double of variable that.startAngle does not match with type boolean of variable that.useFillPaint
    12Type double of variable this.extent does not match with type boolean of variable this.drawOutlines
    13Expression that.extent cannot be parameterized, because it has dependencies to/from statements that will be extracted
    14Expression that.drawOutlines cannot be parameterized, because it has dependencies to/from statements that will be extracted
    15Type double of variable that.extent does not match with type boolean of variable that.drawOutlines
    16Type double of variable this.innerRadius does not match with type boolean of variable this.useOutlinePaint
    17Expression that.innerRadius cannot be parameterized, because it has dependencies to/from statements that will be extracted
    18Expression that.useOutlinePaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    19Type double of variable that.innerRadius does not match with type boolean of variable that.useOutlinePaint
    20Type double of variable this.outerRadius does not match with type boolean of variable this.baseShapesFilled
    21Expression that.outerRadius cannot be parameterized, because it has dependencies to/from statements that will be extracted
    22Expression that.baseShapesFilled cannot be parameterized, because it has dependencies to/from statements that will be extracted
    23Type double of variable that.outerRadius does not match with type boolean of variable that.baseShapesFilled
    24Clone fragment #1 returns variable that with type org.jfree.chart.plot.dial.ArcDialFrame , while Clone fragment #2 returns variable that with type org.jfree.chart.renderer.category.ScatterRenderer
    25Not all possible execution flows end in a return statement
    26The refactoring of the clones is infeasible, because classes org.jfree.chart.plot.dial.ArcDialFrame and org.jfree.chart.renderer.category.ScatterRenderer do not have a common superclass