if (obj == this) { return true; } if (!(obj instanceof XYTitleAnnotation)) { return false; } XYTitleAnnotation that = (XYTitleAnnotation) obj; if (this.coordinateType != that.coordinateType) { return false; } if (this.x != that.x) { return false; } if (this.y != that.y) { return false; } if (this.maxWidth != that.maxWidth) { return false; } if (this.maxHeight != that.maxHeight) { return false; } if (!ObjectUtilities.equal(this.title, that.title)) { return false; } if (!this.anchor.equals(that.anchor)) { return false; } return super.equals(obj);
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/experimental/org/jfree/experimental/chart/annotations/XYTitleAnnotation.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 XYTitleAnnotation)) {
4
        if (!(obj instanceof ArcDialFrame)) {
5
            return false;
5
            return false;
6
        }
6
        }
7
        XYTitleAnnotation that = (XYTitleAnnotation) obj;
7
        ArcDialFrame that = (ArcDialFrame) obj;
8
        if (this.coordinateType != that.coordinateType) {
8
        if (!PaintUtilities.equal(this.backgroundPaint, that.backgroundPaint)) {
9
            return false;
9
            return false;
10
        }
10
        }
11
        if (this.x != that.x) {
11
        if (!PaintUtilities.equal(this.foregroundPaint, that.foregroundPaint)) {
12
            return false;
12
            return false;
13
        }
13
        }
14
        if (this.y != that.y) {
14
        if (this.startAngle != that.startAngle) {
15
            return false;
15
            return false;
16
        }
16
        }
17
        if (this.maxWidth != that.maxWidth) {
17
        if (this.extent != that.extent) {
18
            return false;
18
            return false;
19
        }
19
        }
20
        if (this.maxHeight != that.maxHeight) {
20
        if (this.innerRadius != that.innerRadius) {
21
            return false;
21
            return false;
22
        }
22
        }
23
        if (!ObjectUtilities.equal(this.title, that.title)) {
23
        if (this.outerRadius != that.outerRadius) {
24
            return false;
24
            return false;
25
        }
25
        }
26
        if (!this.anchor.equals(that.anchor)) {
26
        if (!this.stroke.equals(that.stroke)) {
27
            return false;
27
            return false;
28
        }
28
        }
29
        return super.equals(obj);
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)7.4
Clones locationClones are in different classes
Number of node comparisons133
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements17
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)8.5
    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 XYTitleAnnotation))
    3
    if (!(obj instanceof XYTitleAnnotation))
    3
    if (!(obj instanceof ArcDialFrame))
    Differences
    Expression1Expression2Difference
    org.jfree.experimental.chart.annotations.XYTitleAnnotationorg.jfree.chart.plot.dial.ArcDialFrameSUBCLASS_TYPE_MISMATCH
    3
    if (!(obj instanceof ArcDialFrame))
    4
    return false;
    4
    return false;
    5
    XYTitleAnnotation that = (XYTitleAnnotation)obj;
    5
    XYTitleAnnotation that = (XYTitleAnnotation)obj;
    5
    ArcDialFrame that = (ArcDialFrame)obj;
    Differences
    Expression1Expression2Difference
    org.jfree.experimental.chart.annotations.XYTitleAnnotationorg.jfree.chart.plot.dial.ArcDialFrameSUBCLASS_TYPE_MISMATCH
    org.jfree.experimental.chart.annotations.XYTitleAnnotationorg.jfree.chart.plot.dial.ArcDialFrameSUBCLASS_TYPE_MISMATCH
    org.jfree.experimental.chart.annotations.XYTitleAnnotationorg.jfree.chart.plot.dial.ArcDialFrameSUBCLASS_TYPE_MISMATCH
    5
    ArcDialFrame that = (ArcDialFrame)obj;
    6
    if (this.coordinateType != that.coordinateType)
    6
    if (this.coordinateType != that.coordinateType)
    10
    if (this.startAngle != that.startAngle)
    Differences
    Expression1Expression2Difference
    coordinateTypestartAngleVARIABLE_NAME_MISMATCH
    org.jfree.experimental.chart.util.XYCoordinateTypedoubleVARIABLE_TYPE_MISMATCH
    org.jfree.experimental.chart.annotations.XYTitleAnnotationorg.jfree.chart.plot.dial.ArcDialFrameSUBCLASS_TYPE_MISMATCH
    coordinateTypestartAngleVARIABLE_NAME_MISMATCH
    org.jfree.experimental.chart.util.XYCoordinateTypedoubleVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jfree.experimental.chart.util.XYCoordinateType of variable this.coordinateType does not match with type double of variable this.startAngle
    Expression that.coordinateType 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
    Type org.jfree.experimental.chart.util.XYCoordinateType of variable that.coordinateType does not match with type double of variable that.startAngle
    10
    if (this.startAngle != that.startAngle)
    7
    return false;
    11
    return false;
    8
    if (this.x != that.x)
    8
    if (this.x != that.x)
    12
    if (this.extent != that.extent)
    Differences
    Expression1Expression2Difference
    xextentVARIABLE_NAME_MISMATCH
    org.jfree.experimental.chart.annotations.XYTitleAnnotationorg.jfree.chart.plot.dial.ArcDialFrameSUBCLASS_TYPE_MISMATCH
    xextentVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression that.x 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)
    9
    return false;
    13
    return false;
    10
    if (this.y != that.y)
    10
    if (this.y != that.y)
    14
    if (this.innerRadius != that.innerRadius)
    Differences
    Expression1Expression2Difference
    yinnerRadiusVARIABLE_NAME_MISMATCH
    org.jfree.experimental.chart.annotations.XYTitleAnnotationorg.jfree.chart.plot.dial.ArcDialFrameSUBCLASS_TYPE_MISMATCH
    yinnerRadiusVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression that.y 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)
    11
    return false;
    15
    return false;
    12
    if (this.maxWidth != that.maxWidth)
    12
    if (this.maxWidth != that.maxWidth)
    16
    if (this.outerRadius != that.outerRadius)
    Differences
    Expression1Expression2Difference
    maxWidthouterRadiusVARIABLE_NAME_MISMATCH
    org.jfree.experimental.chart.annotations.XYTitleAnnotationorg.jfree.chart.plot.dial.ArcDialFrameSUBCLASS_TYPE_MISMATCH
    maxWidthouterRadiusVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression that.maxWidth 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)
    13
    return false;
    17
    return false;
    14
    if (this.maxHeight != that.maxHeight)
    14
    if (this.maxHeight != that.maxHeight)
    Preondition Violations
    Unmatched statement if(this.maxHeight != that.maxHeight) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                    
    15
    return false;
    15
    return false;
    Preondition Violations
    Unmatched return false;
                                      
    16
    if (!ObjectUtilities.equal(this.title, that.title))
    16
    if (!ObjectUtilities.equal(this.title, that.title))
    8
    if (!PaintUtilities.equal(this.foregroundPaint, that.foregroundPaint))
    Differences
    Expression1Expression2Difference
    titleforegroundPaintVARIABLE_NAME_MISMATCH
    org.jfree.chart.title.Titlejava.awt.PaintVARIABLE_TYPE_MISMATCH
    org.jfree.experimental.chart.annotations.XYTitleAnnotationorg.jfree.chart.plot.dial.ArcDialFrameSUBCLASS_TYPE_MISMATCH
    titleforegroundPaintVARIABLE_NAME_MISMATCH
    org.jfree.chart.title.Titlejava.awt.PaintVARIABLE_TYPE_MISMATCH
    org.jfree.util.ObjectUtilitiesorg.jfree.util.PaintUtilitiesVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jfree.chart.title.Title of variable this.title does not match with type java.awt.Paint of variable this.foregroundPaint
    • Make classes org.jfree.chart.title.Title and java.awt.Paint extend a common superclass
    Expression that.title 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 org.jfree.chart.title.Title of variable that.title does not match with type java.awt.Paint of variable that.foregroundPaint
    • Make classes org.jfree.chart.title.Title 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))
    17
    return false;
    9
    return false;
    18
    if (!this.anchor.equals(that.anchor))
    18
    if (!this.anchor.equals(that.anchor))
    6
    if (!PaintUtilities.equal(this.backgroundPaint, that.backgroundPaint))
    Differences
    Expression1Expression2Difference
    this.anchor.equals(that.anchor)PaintUtilities.equal(this.backgroundPaint,that.backgroundPaint)TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression this.anchor.equals(that.anchor) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression PaintUtilities.equal(this.backgroundPaint,that.backgroundPaint) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6
    if (!PaintUtilities.equal(this.backgroundPaint, that.backgroundPaint))
    19
    return false;
    7
    return false;
    Precondition Violations (22)
    Row Violation
    1Type org.jfree.experimental.chart.util.XYCoordinateType of variable this.coordinateType does not match with type double of variable this.startAngle
    2Expression that.coordinateType cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression that.startAngle cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Type org.jfree.experimental.chart.util.XYCoordinateType of variable that.coordinateType does not match with type double of variable that.startAngle
    5Expression that.x 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.y 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.maxWidth 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
    11Unmatched statement if(this.maxHeight != that.maxHeight) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    12Unmatched return false;
    13Type org.jfree.chart.title.Title of variable this.title does not match with type java.awt.Paint of variable this.foregroundPaint
    14Expression that.title cannot be parameterized, because it has dependencies to/from statements that will be extracted
    15Expression that.foregroundPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    16Type org.jfree.chart.title.Title of variable that.title does not match with type java.awt.Paint of variable that.foregroundPaint
    17Type org.jfree.util.ObjectUtilities does not match with type org.jfree.util.PaintUtilities
    18Expression this.anchor.equals(that.anchor) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    19Expression PaintUtilities.equal(this.backgroundPaint,that.backgroundPaint) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    20Clone fragment #1 returns variable that with type org.jfree.experimental.chart.annotations.XYTitleAnnotation , while Clone fragment #2 returns variable that with type org.jfree.chart.plot.dial.ArcDialFrame
    21Not all possible execution flows end in a return statement
    22The refactoring of the clones is infeasible, because classes org.jfree.experimental.chart.annotations.XYTitleAnnotation and org.jfree.chart.plot.dial.ArcDialFrame do not have a common superclass