if (obj == this) { return true; } if (!(obj instanceof DialTextAnnotation)) { return false; } DialTextAnnotation that = (DialTextAnnotation) obj; if (!this.label.equals(that.label)) { return false; } if (!this.font.equals(that.font)) { return false; } if (!PaintUtilities.equal(this.paint, that.paint)) { return false; } if (this.radius != that.radius) { return false; } if (this.angle != that.angle) { return false; } if (!this.anchor.equals(that.anchor)) { return false; } return super.equals(obj);
if (obj == this) { return true; } if (!(obj instanceof XYDifferenceRenderer)) { return false; } if (!super.equals(obj)) { return false; } XYDifferenceRenderer that = (XYDifferenceRenderer) obj; if (!PaintUtilities.equal(this.positivePaint, that.positivePaint)) { return false; } if (!PaintUtilities.equal(this.negativePaint, that.negativePaint)) { return false; } if (this.shapesVisible != that.shapesVisible) { return false; } if (!ShapeUtilities.equal(this.legendLine, that.legendLine)) { return false; } if (this.roundXCoordinates != that.roundXCoordinates) { return false; } return true;
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/dial/DialTextAnnotation.java File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/xy/XYDifferenceRenderer.java
Method name: boolean equals(Object) Method name: boolean equals(Object)
Number of AST nodes: 18 Number of AST nodes: 18
1
if (obj == this) {
1
if (obj == this) {
2
            return true;
2
            return true;   
3
        }
3
        }
4
        if (!(obj instanceof DialTextAnnotation)) {
4
        if (!(obj instanceof XYDifferenceRenderer)) {
5
            return false;
5
            return false;
6
        }
6
   
7
        DialTextAnnotation that = (DialTextAnnotation) obj;
7
        }
8
        if (!this.label.equals(that.label)) {
8
        if (!super.equals(obj)) {
9
            return false;
9
            return false;   
10
        }
10
        }
11
        if (!this.font
11
        XYDifferenceRenderer that = (XYDifferenceRenderer) obj;
12
.equals(that.font)) {
12
        if (!PaintUtilities.equal(this.positivePaint, that.positivePaint)) {
13
            return false;
13
            return false;   
14
        }
14
        }
15
        if (!PaintUtilities.equal(this.paint, that.paint)) {
15
        if (!PaintUtilities.equal(this.negativePaint, that.negativePaint)) {
16
            return false;
16
            return false;   
17
        }
17
        }
18
        if (this.radius != that.radius) {
18
        if (this.shapesVisible != that.shapesVisible) {
19
            return false;
19
            return false;   
20
        }
20
        }
21
        if (this.angle != that.angle) {
21
        if (!ShapeUtilities.equal(this.legendLine, that.legendLine)) {
22
            return false;
22
            return false;   
23
        }
23
        }
24
        if (!this.anchor.equals(that.anchor)) {
24
        if (this.roundXCoordinates != that.roundXCoordinates) {
25
            return false;
25
            return false;
26
        }
26
        }
27
        return super.equals(obj);
27
        return true;
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)4.6
Clones locationClones are in different classes
Number of node comparisons125
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements17
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)6.3
    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 DialTextAnnotation))
    3
    if (!(obj instanceof DialTextAnnotation))
    3
    if (!(obj instanceof XYDifferenceRenderer))
    Differences
    Expression1Expression2Difference
    org.jfree.chart.plot.dial.DialTextAnnotationorg.jfree.chart.renderer.xy.XYDifferenceRendererSUBCLASS_TYPE_MISMATCH
    3
    if (!(obj instanceof XYDifferenceRenderer))
    4
    return false;
    4
    return false;
    5
    DialTextAnnotation that = (DialTextAnnotation)obj;
                                                                                                          
    6
    if (!this.label.equals(that.label))
    6
    if (!this.label.equals(that.label))
    5
    if (!super.equals(obj))
    Differences
    Expression1Expression2Difference
    this.label.equals(that.label)super.equals(obj)TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression this.label.equals(that.label) 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
    5
    if (!super.equals(obj))
    7
    return false;
    6
    return false;
                                                                                                                  
    7
    XYDifferenceRenderer that = (XYDifferenceRenderer)obj;
    8
    if (!this.font.equals(that.font))
    8
    if (!this.font.equals(that.font))
    8
    if (!PaintUtilities.equal(this.positivePaint, that.positivePaint))
    Differences
    Expression1Expression2Difference
    this.font.equals(that.font)PaintUtilities.equal(this.positivePaint,that.positivePaint)TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression this.font.equals(that.font) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression PaintUtilities.equal(this.positivePaint,that.positivePaint) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8
    if (!PaintUtilities.equal(this.positivePaint, that.positivePaint))
    9
    return false;
    9
    return false;
    10
    if (!PaintUtilities.equal(this.paint, that.paint))
    10
    if (!PaintUtilities.equal(this.paint, that.paint))
    10
    if (!PaintUtilities.equal(this.negativePaint, that.negativePaint))
    Differences
    Expression1Expression2Difference
    paintnegativePaintVARIABLE_NAME_MISMATCH
    org.jfree.chart.plot.dial.DialTextAnnotationorg.jfree.chart.renderer.xy.XYDifferenceRendererSUBCLASS_TYPE_MISMATCH
    paintnegativePaintVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression that.paint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.negativePaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10
    if (!PaintUtilities.equal(this.negativePaint, that.negativePaint))
    11
    return false;
    11
    return false;
    12
    if (this.radius != that.radius)
    12
    if (this.radius != that.radius)
    12
    if (this.shapesVisible != that.shapesVisible)
    Differences
    Expression1Expression2Difference
    radiusshapesVisibleVARIABLE_NAME_MISMATCH
    doublebooleanVARIABLE_TYPE_MISMATCH
    org.jfree.chart.plot.dial.DialTextAnnotationorg.jfree.chart.renderer.xy.XYDifferenceRendererSUBCLASS_TYPE_MISMATCH
    radiusshapesVisibleVARIABLE_NAME_MISMATCH
    doublebooleanVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type double of variable this.radius does not match with type boolean of variable this.shapesVisible
    Expression that.radius cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.shapesVisible cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type double of variable that.radius does not match with type boolean of variable that.shapesVisible
    12
    if (this.shapesVisible != that.shapesVisible)
    13
    return false;
    13
    return false;
    14
    if (this.angle != that.angle)
    14
    if (this.angle != that.angle)
    16
    if (this.roundXCoordinates != that.roundXCoordinates)
    Differences
    Expression1Expression2Difference
    angleroundXCoordinatesVARIABLE_NAME_MISMATCH
    doublebooleanVARIABLE_TYPE_MISMATCH
    org.jfree.chart.plot.dial.DialTextAnnotationorg.jfree.chart.renderer.xy.XYDifferenceRendererSUBCLASS_TYPE_MISMATCH
    angleroundXCoordinatesVARIABLE_NAME_MISMATCH
    doublebooleanVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type double of variable this.angle does not match with type boolean of variable this.roundXCoordinates
    Expression that.angle cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.roundXCoordinates cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type double of variable that.angle does not match with type boolean of variable that.roundXCoordinates
    16
    if (this.roundXCoordinates != that.roundXCoordinates)
    15
    return false;
    17
    return false;
    16
    if (!this.anchor.equals(that.anchor))
    16
    if (!this.anchor.equals(that.anchor))
    14
    if (!ShapeUtilities.equal(this.legendLine, that.legendLine))
    Differences
    Expression1Expression2Difference
    this.anchor.equals(that.anchor)ShapeUtilities.equal(this.legendLine,that.legendLine)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 ShapeUtilities.equal(this.legendLine,that.legendLine) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    14
    if (!ShapeUtilities.equal(this.legendLine, that.legendLine))
    17
    return false;
    15
    return false;
    18
    return super.equals(obj);
    18
    return super.equals(obj);
    18
    return true;
    Differences
    Expression1Expression2Difference
    super.equals(obj)trueTYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Super method call return super.equals(obj); cannot be extracted from method
    18
    return true;
    Precondition Violations (18)
    Row Violation
    1Expression this.label.equals(that.label) 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 this.font.equals(that.font) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression PaintUtilities.equal(this.positivePaint,that.positivePaint) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression that.paint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression that.negativePaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Type double of variable this.radius does not match with type boolean of variable this.shapesVisible
    8Expression that.radius cannot be parameterized, because it has dependencies to/from statements that will be extracted
    9Expression that.shapesVisible cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10Type double of variable that.radius does not match with type boolean of variable that.shapesVisible
    11Type double of variable this.angle does not match with type boolean of variable this.roundXCoordinates
    12Expression that.angle cannot be parameterized, because it has dependencies to/from statements that will be extracted
    13Expression that.roundXCoordinates cannot be parameterized, because it has dependencies to/from statements that will be extracted
    14Type double of variable that.angle does not match with type boolean of variable that.roundXCoordinates
    15Expression this.anchor.equals(that.anchor) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    16Expression ShapeUtilities.equal(this.legendLine,that.legendLine) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    17Super method call return super.equals(obj); cannot be extracted from method
    18The refactoring of the clones is infeasible, because classes org.jfree.chart.plot.dial.DialTextAnnotation and org.jfree.chart.renderer.xy.XYDifferenceRenderer do not have a common superclass