if (obj == this) { return true; } if (!(obj instanceof CyclicNumberAxis)) { return false; } if (!super.equals(obj)) { return false; } CyclicNumberAxis that = (CyclicNumberAxis) obj; if (this.period != that.period) { return false; } if (this.offset != that.offset) { return false; } if (!PaintUtilities.equal(this.advanceLinePaint, that.advanceLinePaint)) { return false; } if (!ObjectUtilities.equal(this.advanceLineStroke, that.advanceLineStroke)) { return false; } if (this.advanceLineVisible != that.advanceLineVisible) { return false; } if (this.boundMappedToLastCycle != that.boundMappedToLastCycle) { 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/axis/CyclicNumberAxis.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 CyclicNumberAxis)) {
4
        if (!(obj instanceof ArcDialFrame)) {
5
            return false;
5
            return false;
6
        }
6
        }
7
        if (!super.equals(obj)) {
7
        
8
            return false;
9
        }
10
        CyclicNumberAxis that = (CyclicNumberAxis) obj;      
11
        if (this.period != that.period
8
ArcDialFrame that = (ArcDialFrame) obj;
9
        if (!PaintUtilities.equal(this.backgroundPaint, that.backgroundPaint)) {
10
            return false;
11
        }
12
) {
12
        if (!PaintUtilities.equal(this.foregroundPaint, that.foregroundPaint)) {
13
            return false;
13
            return false;
14
        }
14
        }
15
        if (this.offset != that.offset) {
15
        if (this.startAngle != that.startAngle) {
16
            return false;
16
            return false;
17
        }
17
        }
18
        if (!PaintUtilities.equal(this.advanceLinePaint, 
18
        if (
19
                that.advanceLinePaint)) {
19
this.extent != that.extent) {
20
            return false;
20
            return false;
21
        }
21
        }
22
        if (!ObjectUtilities.equal(this.advanceLineStroke, 
22
        if (
23
                that.advanceLineStroke)) {
23
this.innerRadius != that.innerRadius) {
24
            return false;
24
            return false;
25
        }
25
        }
26
        if (this.advanceLineVisible != that.advanceLineVisible) {
26
        if (this.outerRadius != that.outerRadius) {
27
            return false;
27
            return false;
28
        }
28
        }
29
        if (this.boundMappedToLastCycle != that.boundMappedToLastCycle) {
29
        if (!this.stroke.equals(that.stroke)) {
30
            return false;
30
            return false;
31
        }
31
        }
32
        return true;
32
        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)7.4
Clones locationClones are in different classes
Number of node comparisons148
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements19
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)8.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 CyclicNumberAxis))
    3
    if (!(obj instanceof CyclicNumberAxis))
    3
    if (!(obj instanceof ArcDialFrame))
    Differences
    Expression1Expression2Difference
    org.jfree.chart.axis.CyclicNumberAxisorg.jfree.chart.plot.dial.ArcDialFrameSUBCLASS_TYPE_MISMATCH
    3
    if (!(obj instanceof ArcDialFrame))
    4
    return false;
    4
    return false;
                                                                                  
    5
    ArcDialFrame that = (ArcDialFrame)obj;
    5
    if (!super.equals(obj))
    5
    if (!super.equals(obj))
    18
    if (!this.stroke.equals(that.stroke))
    Differences
    Expression1Expression2Difference
    super.equals(obj)this.stroke.equals(that.stroke)TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression this.stroke.equals(that.stroke) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Super method call if(!super.equals(obj)) cannot be extracted from method
    18
    if (!this.stroke.equals(that.stroke))
    6
    return false;
    19
    return false;
    7
    CyclicNumberAxis that = (CyclicNumberAxis)obj;
                                                                                                  
    8
    if (this.period != that.period)
    8
    if (this.period != that.period)
    10
    if (this.startAngle != that.startAngle)
    Differences
    Expression1Expression2Difference
    periodstartAngleVARIABLE_NAME_MISMATCH
    org.jfree.chart.axis.CyclicNumberAxisorg.jfree.chart.plot.dial.ArcDialFrameSUBCLASS_TYPE_MISMATCH
    periodstartAngleVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression that.period cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.startAngle cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10
    if (this.startAngle != that.startAngle)
    9
    return false;
    11
    return false;
    10
    if (this.offset != that.offset)
    10
    if (this.offset != that.offset)
    12
    if (this.extent != that.extent)
    Differences
    Expression1Expression2Difference
    offsetextentVARIABLE_NAME_MISMATCH
    org.jfree.chart.axis.CyclicNumberAxisorg.jfree.chart.plot.dial.ArcDialFrameSUBCLASS_TYPE_MISMATCH
    offsetextentVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression that.offset 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)
    11
    return false;
    13
    return false;
    12
    if (!PaintUtilities.equal(this.advanceLinePaint, that.advanceLinePaint))
    12
    if (!PaintUtilities.equal(this.advanceLinePaint, that.advanceLinePaint))
    8
    if (!PaintUtilities.equal(this.foregroundPaint, that.foregroundPaint))
    Differences
    Expression1Expression2Difference
    advanceLinePaintforegroundPaintVARIABLE_NAME_MISMATCH
    org.jfree.chart.axis.CyclicNumberAxisorg.jfree.chart.plot.dial.ArcDialFrameSUBCLASS_TYPE_MISMATCH
    advanceLinePaintforegroundPaintVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression that.advanceLinePaint 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))
    13
    return false;
    9
    return false;
    14
    if (!ObjectUtilities.equal(this.advanceLineStroke, that.advanceLineStroke))
    14
    if (!ObjectUtilities.equal(this.advanceLineStroke, that.advanceLineStroke))
    6
    if (!PaintUtilities.equal(this.backgroundPaint, that.backgroundPaint))
    Differences
    Expression1Expression2Difference
    advanceLineStrokebackgroundPaintVARIABLE_NAME_MISMATCH
    java.awt.Strokejava.awt.PaintVARIABLE_TYPE_MISMATCH
    org.jfree.chart.axis.CyclicNumberAxisorg.jfree.chart.plot.dial.ArcDialFrameSUBCLASS_TYPE_MISMATCH
    advanceLineStrokebackgroundPaintVARIABLE_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.advanceLineStroke does not match with type java.awt.Paint of variable this.backgroundPaint
    • Make classes java.awt.Stroke and java.awt.Paint extend a common superclass
    Expression that.advanceLineStroke 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
    Type java.awt.Stroke of variable that.advanceLineStroke does not match with type java.awt.Paint of variable that.backgroundPaint
    • 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
    6
    if (!PaintUtilities.equal(this.backgroundPaint, that.backgroundPaint))
    15
    return false;
    7
    return false;
    16
    if (this.advanceLineVisible != that.advanceLineVisible)
    16
    if (this.advanceLineVisible != that.advanceLineVisible)
    16
    if (this.outerRadius != that.outerRadius)
    Differences
    Expression1Expression2Difference
    advanceLineVisibleouterRadiusVARIABLE_NAME_MISMATCH
    booleandoubleVARIABLE_TYPE_MISMATCH
    org.jfree.chart.axis.CyclicNumberAxisorg.jfree.chart.plot.dial.ArcDialFrameSUBCLASS_TYPE_MISMATCH
    advanceLineVisibleouterRadiusVARIABLE_NAME_MISMATCH
    booleandoubleVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type boolean of variable this.advanceLineVisible does not match with type double of variable this.outerRadius
    Expression that.advanceLineVisible 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
    Type boolean of variable that.advanceLineVisible does not match with type double of variable that.outerRadius
    16
    if (this.outerRadius != that.outerRadius)
    17
    return false;
    17
    return false;
    18
    if (this.boundMappedToLastCycle != that.boundMappedToLastCycle)
    18
    if (this.boundMappedToLastCycle != that.boundMappedToLastCycle)
    14
    if (this.innerRadius != that.innerRadius)
    Differences
    Expression1Expression2Difference
    boundMappedToLastCycleinnerRadiusVARIABLE_NAME_MISMATCH
    booleandoubleVARIABLE_TYPE_MISMATCH
    org.jfree.chart.axis.CyclicNumberAxisorg.jfree.chart.plot.dial.ArcDialFrameSUBCLASS_TYPE_MISMATCH
    boundMappedToLastCycleinnerRadiusVARIABLE_NAME_MISMATCH
    booleandoubleVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type boolean of variable this.boundMappedToLastCycle does not match with type double of variable this.innerRadius
    Expression that.boundMappedToLastCycle 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 boolean of variable that.boundMappedToLastCycle does not match with type double of variable that.innerRadius
    14
    if (this.innerRadius != that.innerRadius)
    19
    return false;
    15
    return false;
    20
    return true;
    20
    return true;
    20
    return super.equals(obj);
    Differences
    Expression1Expression2Difference
    truesuper.equals(obj)TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Super method call return super.equals(obj); cannot be extracted from method
    20
    return super.equals(obj);
    Precondition Violations (23)
    Row Violation
    1Expression this.stroke.equals(that.stroke) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Super method call if(!super.equals(obj)) cannot be extracted from method
    3Expression that.period cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression that.startAngle cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression that.offset cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression that.extent cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression that.advanceLinePaint 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 this.advanceLineStroke does not match with type java.awt.Paint of variable this.backgroundPaint
    10Expression that.advanceLineStroke cannot be parameterized, because it has dependencies to/from statements that will be extracted
    11Expression that.backgroundPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    12Type java.awt.Stroke of variable that.advanceLineStroke does not match with type java.awt.Paint of variable that.backgroundPaint
    13Type org.jfree.util.ObjectUtilities does not match with type org.jfree.util.PaintUtilities
    14Type boolean of variable this.advanceLineVisible does not match with type double of variable this.outerRadius
    15Expression that.advanceLineVisible cannot be parameterized, because it has dependencies to/from statements that will be extracted
    16Expression that.outerRadius cannot be parameterized, because it has dependencies to/from statements that will be extracted
    17Type boolean of variable that.advanceLineVisible does not match with type double of variable that.outerRadius
    18Type boolean of variable this.boundMappedToLastCycle does not match with type double of variable this.innerRadius
    19Expression that.boundMappedToLastCycle cannot be parameterized, because it has dependencies to/from statements that will be extracted
    20Expression that.innerRadius cannot be parameterized, because it has dependencies to/from statements that will be extracted
    21Type boolean of variable that.boundMappedToLastCycle does not match with type double of variable that.innerRadius
    22Super method call return super.equals(obj); cannot be extracted from method
    23The refactoring of the clones is infeasible, because classes org.jfree.chart.axis.CyclicNumberAxis and org.jfree.chart.plot.dial.ArcDialFrame do not have a common superclass