if (obj == this) { return true; } if (!super.equals(obj)) { return false; } if (!(obj instanceof XYLineAnnotation)) { return false; } XYLineAnnotation that = (XYLineAnnotation) obj; if (this.x1 != that.x1) { return false; } if (this.y1 != that.y1) { return false; } if (this.x2 != that.x2) { return false; } if (this.y2 != that.y2) { return false; } if (!PaintUtilities.equal(this.paint, that.paint)) { return false; } if (!ObjectUtilities.equal(this.stroke, that.stroke)) { return false; } // seems to be the same... 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/annotations/XYLineAnnotation.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 (!super.equals(obj)) {
4
        if (!(obj instanceof ArcDialFrame)) {
5
            return false;
5
            return false;
6
        }
6
        }
7
        if (!(obj instanceof XYLineAnnotation)) {
7
        
8
            return false;
9
        }
10
        XYLineAnnotation that = (XYLineAnnotation) obj;
11
        if (this.x1 != that.x1
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.y1 != that.y1) {
15
        if (this.startAngle != that.startAngle) {
16
            return false;
16
            return false;
17
        }
17
        }
18
        if (this.x2 != that.x2) {
18
        if (this.extent != that.extent) {
19
            return false;
19
            return false;
20
        }
20
        }
21
        if (this.y2 != that.y2) {
21
        if (this.innerRadius != that.innerRadius) {
22
            return false;
22
            return false;
23
        }
23
        }
24
        if (!PaintUtilities.equal(this.paint, that.paint)) {
24
        if (this.outerRadius != that.outerRadius) {
25
            return false;
25
            return false;
26
        }
26
        }
27
        if (!ObjectUtilities.equal(this.stroke, that.stroke)) {
27
        if (!this.stroke.equals(that.stroke)) {
28
            return false;
28
            return false;
29
        }
29
        }
30
        // seems to be the same...
30
        
31
        return true;
31
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.9
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 (!super.equals(obj))
    3
    if (!super.equals(obj))
    3
    if (!(obj instanceof ArcDialFrame))
    Differences
    Expression1Expression2Difference
    super.equals(obj)(obj instanceof ArcDialFrame)TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Super method call if(!super.equals(obj)) cannot be extracted from method
    3
    if (!(obj instanceof ArcDialFrame))
    4
    return false;
    4
    return false;
                                                                                  
    5
    ArcDialFrame that = (ArcDialFrame)obj;
    5
    if (!(obj instanceof XYLineAnnotation))
    5
    if (!(obj instanceof XYLineAnnotation))
    18
    if (!this.stroke.equals(that.stroke))
    Differences
    Expression1Expression2Difference
    (obj instanceof XYLineAnnotation)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
    18
    if (!this.stroke.equals(that.stroke))
    6
    return false;
    19
    return false;
    7
    XYLineAnnotation that = (XYLineAnnotation)obj;
                                                                                                  
    8
    if (this.x1 != that.x1)
    8
    if (this.x1 != that.x1)
    10
    if (this.startAngle != that.startAngle)
    Differences
    Expression1Expression2Difference
    x1startAngleVARIABLE_NAME_MISMATCH
    org.jfree.chart.annotations.XYLineAnnotationorg.jfree.chart.plot.dial.ArcDialFrameSUBCLASS_TYPE_MISMATCH
    x1startAngleVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression that.x1 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.y1 != that.y1)
    10
    if (this.y1 != that.y1)
    12
    if (this.extent != that.extent)
    Differences
    Expression1Expression2Difference
    y1extentVARIABLE_NAME_MISMATCH
    org.jfree.chart.annotations.XYLineAnnotationorg.jfree.chart.plot.dial.ArcDialFrameSUBCLASS_TYPE_MISMATCH
    y1extentVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression that.y1 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 (this.x2 != that.x2)
    12
    if (this.x2 != that.x2)
    14
    if (this.innerRadius != that.innerRadius)
    Differences
    Expression1Expression2Difference
    x2innerRadiusVARIABLE_NAME_MISMATCH
    org.jfree.chart.annotations.XYLineAnnotationorg.jfree.chart.plot.dial.ArcDialFrameSUBCLASS_TYPE_MISMATCH
    x2innerRadiusVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression that.x2 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
    14
    if (this.innerRadius != that.innerRadius)
    13
    return false;
    15
    return false;
    14
    if (this.y2 != that.y2)
    14
    if (this.y2 != that.y2)
    16
    if (this.outerRadius != that.outerRadius)
    Differences
    Expression1Expression2Difference
    y2outerRadiusVARIABLE_NAME_MISMATCH
    org.jfree.chart.annotations.XYLineAnnotationorg.jfree.chart.plot.dial.ArcDialFrameSUBCLASS_TYPE_MISMATCH
    y2outerRadiusVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression that.y2 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)
    15
    return false;
    17
    return false;
    16
    if (!PaintUtilities.equal(this.paint, that.paint))
    16
    if (!PaintUtilities.equal(this.paint, that.paint))
    8
    if (!PaintUtilities.equal(this.foregroundPaint, that.foregroundPaint))
    Differences
    Expression1Expression2Difference
    paintforegroundPaintVARIABLE_NAME_MISMATCH
    org.jfree.chart.annotations.XYLineAnnotationorg.jfree.chart.plot.dial.ArcDialFrameSUBCLASS_TYPE_MISMATCH
    paintforegroundPaintVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression that.paint 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))
    17
    return false;
    9
    return false;
    18
    if (!ObjectUtilities.equal(this.stroke, that.stroke))
    18
    if (!ObjectUtilities.equal(this.stroke, that.stroke))
    6
    if (!PaintUtilities.equal(this.backgroundPaint, that.backgroundPaint))
    Differences
    Expression1Expression2Difference
    strokebackgroundPaintVARIABLE_NAME_MISMATCH
    java.awt.Strokejava.awt.PaintVARIABLE_TYPE_MISMATCH
    org.jfree.chart.annotations.XYLineAnnotationorg.jfree.chart.plot.dial.ArcDialFrameSUBCLASS_TYPE_MISMATCH
    strokebackgroundPaintVARIABLE_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.stroke 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.stroke 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.stroke 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))
    19
    return false;
    7
    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 (19)
    Row Violation
    1Super method call if(!super.equals(obj)) cannot be extracted from method
    2Expression this.stroke.equals(that.stroke) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression that.x1 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.y1 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.x2 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Expression that.innerRadius cannot be parameterized, because it has dependencies to/from statements that will be extracted
    9Expression that.y2 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10Expression that.outerRadius cannot be parameterized, because it has dependencies to/from statements that will be extracted
    11Expression that.paint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    12Expression that.foregroundPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    13Type java.awt.Stroke of variable this.stroke does not match with type java.awt.Paint of variable this.backgroundPaint
    14Expression that.stroke cannot be parameterized, because it has dependencies to/from statements that will be extracted
    15Expression that.backgroundPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    16Type java.awt.Stroke of variable that.stroke does not match with type java.awt.Paint of variable that.backgroundPaint
    17Type org.jfree.util.ObjectUtilities does not match with type org.jfree.util.PaintUtilities
    18Super method call return super.equals(obj); cannot be extracted from method
    19The refactoring of the clones is infeasible, because classes org.jfree.chart.annotations.XYLineAnnotation and org.jfree.chart.plot.dial.ArcDialFrame do not have a common superclass