if (obj == this) { return true; } if (!(obj instanceof MeterNeedle)) { return false; } MeterNeedle that = (MeterNeedle) obj; if (!PaintUtilities.equal(this.outlinePaint, that.outlinePaint)) { return false; } if (!ObjectUtilities.equal(this.outlineStroke, that.outlineStroke)) { return false; } if (!PaintUtilities.equal(this.fillPaint, that.fillPaint)) { return false; } if (!PaintUtilities.equal(this.highlightPaint, that.highlightPaint)) { return false; } if (this.size != that.size) { return false; } if (this.rotateX != that.rotateX) { return false; } if (this.rotateY != that.rotateY) { return false; } return true;
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);
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/needle/MeterNeedle.java File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/dial/ArcDialFrame.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 MeterNeedle)) {
4
        if (!(obj instanceof ArcDialFrame)) {
5
            return false;
5
            return false;
6
        }
6
        }
7
        MeterNeedle that = (MeterNeedle) obj;
7
        ArcDialFrame that = (ArcDialFrame) obj;
8
        if (!PaintUtilities.equal(this.outlinePaint, that.outlinePaint)) {
8
        if (!PaintUtilities.equal(this.backgroundPaint, that.backgroundPaint)) {
9
            return false;
9
            return false;
10
        }
10
        }
11
        if (!ObjectUtilities.equal(this.outlineStroke, that.outlineStroke)) {
11
        if (!PaintUtilities.equal(this.foregroundPaint, that.foregroundPaint)) {
12
            return false;
12
            return false;
13
        }
13
        }
14
        if (!PaintUtilities.equal(this.fillPaint, that.fillPaint)) {
14
        if (this.startAngle != that.startAngle) {
15
            return false;
15
            return false;
16
        }
16
        }
17
        if (!PaintUtilities.equal(this.highlightPaint, that.highlightPaint)) {
17
        if (this.extent != that.extent) {
18
            return false;
18
            return false;
19
        }
19
        }
20
        if (this.size != that.size) {
20
        if (this.innerRadius != that.innerRadius) {
21
            return false;
21
            return false;
22
        }
22
        }
23
        if (this.rotateX != that.rotateX) {
23
        if (this.outerRadius != that.outerRadius) {
24
            return false;
24
            return false;
25
        }
25
        }
26
        if (this.rotateY != that.rotateY) {
26
        if (!this.stroke.equals(that.stroke)) {
27
            return false;
27
            return false;
28
        }
28
        }
29
        return true;
29
        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)5.4
Clones locationClones are in different classes
Number of node comparisons142
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements16
    Number of unmapped statements in the first code fragment3
    Number of unmapped statements in the second code fragment3
    Time elapsed for statement mapping (ms)7.2
    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 MeterNeedle))
    3
    if (!(obj instanceof MeterNeedle))
    3
    if (!(obj instanceof ArcDialFrame))
    Differences
    Expression1Expression2Difference
    org.jfree.chart.needle.MeterNeedleorg.jfree.chart.plot.dial.ArcDialFrameVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jfree.chart.needle.MeterNeedle does not match with type org.jfree.chart.plot.dial.ArcDialFrame
    • Make classes org.jfree.chart.needle.MeterNeedle and org.jfree.chart.plot.dial.ArcDialFrame extend a common superclass
    3
    if (!(obj instanceof ArcDialFrame))
    4
    return false;
    4
    return false;
                                                                                  
    5
    ArcDialFrame that = (ArcDialFrame)obj;
    5
    MeterNeedle that = (MeterNeedle)obj;
                                                                              
    6
    if (!PaintUtilities.equal(this.outlinePaint, that.outlinePaint))
    6
    if (!PaintUtilities.equal(this.outlinePaint, that.outlinePaint))
    6
    if (!PaintUtilities.equal(this.backgroundPaint, that.backgroundPaint))
    Differences
    Expression1Expression2Difference
    outlinePaintbackgroundPaintVARIABLE_NAME_MISMATCH
    org.jfree.chart.needle.MeterNeedleorg.jfree.chart.plot.dial.ArcDialFrameVARIABLE_TYPE_MISMATCH
    outlinePaintbackgroundPaintVARIABLE_NAME_MISMATCH
    Preondition Violations
    Type java.awt.Paint of variable that.outlinePaint does not match with type java.awt.Paint of variable that.backgroundPaint
    • Make classes org.jfree.chart.needle.MeterNeedle and org.jfree.chart.plot.dial.ArcDialFrame extend a common superclass
    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))
    7
    return false;
    7
    return false;
    8
    if (!ObjectUtilities.equal(this.outlineStroke, that.outlineStroke))
    8
    if (!ObjectUtilities.equal(this.outlineStroke, that.outlineStroke))
    8
    if (!PaintUtilities.equal(this.foregroundPaint, that.foregroundPaint))
    Differences
    Expression1Expression2Difference
    outlineStrokeforegroundPaintVARIABLE_NAME_MISMATCH
    java.awt.Strokejava.awt.PaintVARIABLE_TYPE_MISMATCH
    org.jfree.chart.needle.MeterNeedleorg.jfree.chart.plot.dial.ArcDialFrameVARIABLE_TYPE_MISMATCH
    outlineStrokeforegroundPaintVARIABLE_NAME_MISMATCH
    java.awt.Strokejava.awt.PaintVARIABLE_TYPE_MISMATCH
    org.jfree.util.ObjectUtilitiesorg.jfree.util.PaintUtilitiesVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.awt.Stroke of variable this.outlineStroke does not match with type java.awt.Paint of variable this.foregroundPaint
    • Make classes java.awt.Stroke and java.awt.Paint extend a common superclass
    Type java.awt.Stroke of variable that.outlineStroke does not match with type java.awt.Paint of variable that.foregroundPaint
    • Make classes org.jfree.chart.needle.MeterNeedle and org.jfree.chart.plot.dial.ArcDialFrame extend a common superclass
    Expression that.outlineStroke 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
    Type java.awt.Stroke of variable that.outlineStroke does not match with type java.awt.Paint of variable that.foregroundPaint
    • Make classes java.awt.Stroke and java.awt.Paint extend a common superclass
    Type org.jfree.util.ObjectUtilities does not match with type org.jfree.util.PaintUtilities
    • Make classes org.jfree.util.ObjectUtilities and org.jfree.util.PaintUtilities extend a common superclass
    8
    if (!PaintUtilities.equal(this.foregroundPaint, that.foregroundPaint))
    9
    return false;
    9
    return false;
                                                                                        
    10
    if (this.startAngle != that.startAngle)
                                      
    11
    return false;
    Preondition Violations
    Unmatched return false;
    11
    return false;
    10
    if (!PaintUtilities.equal(this.fillPaint, that.fillPaint))
    10
    if (!PaintUtilities.equal(this.fillPaint, that.fillPaint))
    18
    if (!this.stroke.equals(that.stroke))
    Differences
    Expression1Expression2Difference
    PaintUtilities.equal(this.fillPaint,that.fillPaint)this.stroke.equals(that.stroke)TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression PaintUtilities.equal(this.fillPaint,that.fillPaint) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression this.stroke.equals(that.stroke) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    18
    if (!this.stroke.equals(that.stroke))
    11
    return false;
    19
    return false;
    12
    if (!PaintUtilities.equal(this.highlightPaint, that.highlightPaint))
                                                                                                                                                
    13
    return false;
    13
    return false;
    Preondition Violations
    Unmatched return false;
                                      
    14
    if (this.size != that.size)
    14
    if (this.size != that.size)
    14
    if (this.innerRadius != that.innerRadius)
    Differences
    Expression1Expression2Difference
    sizeinnerRadiusVARIABLE_NAME_MISMATCH
    intdoubleVARIABLE_TYPE_MISMATCH
    org.jfree.chart.needle.MeterNeedleorg.jfree.chart.plot.dial.ArcDialFrameVARIABLE_TYPE_MISMATCH
    sizeinnerRadiusVARIABLE_NAME_MISMATCH
    intdoubleVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type int of variable this.size does not match with type double of variable this.innerRadius
    Type int of variable that.size does not match with type double of variable that.innerRadius
    • Make classes org.jfree.chart.needle.MeterNeedle and org.jfree.chart.plot.dial.ArcDialFrame extend a common superclass
    Expression that.size cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.innerRadius cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type int of variable that.size does not match with type double of variable that.innerRadius
    14
    if (this.innerRadius != that.innerRadius)
    15
    return false;
    15
    return false;
    16
    if (this.rotateX != that.rotateX)
    16
    if (this.rotateX != that.rotateX)
    16
    if (this.outerRadius != that.outerRadius)
    Differences
    Expression1Expression2Difference
    rotateXouterRadiusVARIABLE_NAME_MISMATCH
    org.jfree.chart.needle.MeterNeedleorg.jfree.chart.plot.dial.ArcDialFrameVARIABLE_TYPE_MISMATCH
    rotateXouterRadiusVARIABLE_NAME_MISMATCH
    Preondition Violations
    Type double of variable that.rotateX does not match with type double of variable that.outerRadius
    • Make classes org.jfree.chart.needle.MeterNeedle and org.jfree.chart.plot.dial.ArcDialFrame extend a common superclass
    Expression that.rotateX cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.outerRadius cannot be parameterized, because it has dependencies to/from statements that will be extracted
    16
    if (this.outerRadius != that.outerRadius)
    17
    return false;
    17
    return false;
    18
    if (this.rotateY != that.rotateY)
    18
    if (this.rotateY != that.rotateY)
    12
    if (this.extent != that.extent)
    Differences
    Expression1Expression2Difference
    rotateYextentVARIABLE_NAME_MISMATCH
    org.jfree.chart.needle.MeterNeedleorg.jfree.chart.plot.dial.ArcDialFrameVARIABLE_TYPE_MISMATCH
    rotateYextentVARIABLE_NAME_MISMATCH
    Preondition Violations
    Type double of variable that.rotateY does not match with type double of variable that.extent
    • Make classes org.jfree.chart.needle.MeterNeedle and org.jfree.chart.plot.dial.ArcDialFrame extend a common superclass
    Expression that.rotateY cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.extent cannot be parameterized, because it has dependencies to/from statements that will be extracted
    12
    if (this.extent != that.extent)
    19
    return false;
    13
    return false;
    Precondition Violations (27)
    Row Violation
    1Type org.jfree.chart.needle.MeterNeedle does not match with type org.jfree.chart.plot.dial.ArcDialFrame
    2Type java.awt.Paint of variable that.outlinePaint does not match with type java.awt.Paint of variable that.backgroundPaint
    3Expression that.outlinePaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression that.backgroundPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Type java.awt.Stroke of variable this.outlineStroke does not match with type java.awt.Paint of variable this.foregroundPaint
    6Type java.awt.Stroke of variable that.outlineStroke does not match with type java.awt.Paint of variable that.foregroundPaint
    7Expression that.outlineStroke cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Expression that.foregroundPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    9Type java.awt.Stroke of variable that.outlineStroke does not match with type java.awt.Paint of variable that.foregroundPaint
    10Type org.jfree.util.ObjectUtilities does not match with type org.jfree.util.PaintUtilities
    11Unmatched return false;
    12Expression PaintUtilities.equal(this.fillPaint,that.fillPaint) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    13Expression this.stroke.equals(that.stroke) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    14Unmatched return false;
    15Type int of variable this.size does not match with type double of variable this.innerRadius
    16Type int of variable that.size does not match with type double of variable that.innerRadius
    17Expression that.size cannot be parameterized, because it has dependencies to/from statements that will be extracted
    18Expression that.innerRadius cannot be parameterized, because it has dependencies to/from statements that will be extracted
    19Type int of variable that.size does not match with type double of variable that.innerRadius
    20Type double of variable that.rotateX does not match with type double of variable that.outerRadius
    21Expression that.rotateX cannot be parameterized, because it has dependencies to/from statements that will be extracted
    22Expression that.outerRadius cannot be parameterized, because it has dependencies to/from statements that will be extracted
    23Type double of variable that.rotateY does not match with type double of variable that.extent
    24Expression that.rotateY cannot be parameterized, because it has dependencies to/from statements that will be extracted
    25Expression that.extent cannot be parameterized, because it has dependencies to/from statements that will be extracted
    26Not all possible execution flows end in a return statement
    27The refactoring of the clones is infeasible, because classes org.jfree.chart.needle.MeterNeedle and org.jfree.chart.plot.dial.ArcDialFrame do not have a common superclass