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 (this == obj) { return true; } if (!(obj instanceof HighLowRenderer)) { return false; } HighLowRenderer that = (HighLowRenderer) obj; if (this.drawOpenTicks != that.drawOpenTicks) { return false; } if (this.drawCloseTicks != that.drawCloseTicks) { return false; } if (!PaintUtilities.equal(this.openTickPaint, that.openTickPaint)) { return false; } if (!PaintUtilities.equal(this.closeTickPaint, that.closeTickPaint)) { return false; } if (this.tickLength != that.tickLength) { return false; } if (!super.equals(obj)) { 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/HighLowRenderer.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 (this == obj) {
2
            return true;
2
            return true;
3
        }
3
        }
4
        if (!(obj instanceof DialTextAnnotation)) {
4
        if (!(obj instanceof HighLowRenderer)) {
5
            return false;
5
            return false;
6
        }
6
        }
7
        DialTextAnnotation that = (DialTextAnnotation) obj;
7
        HighLowRenderer that = (HighLowRenderer) obj;
8
        if (!this.label.equals(that.label)) {
8
        if (this.drawOpenTicks != that.drawOpenTicks) {
9
            return false;
9
            return false;
10
        }
10
        }
11
        if (!this.font.equals(that.font)) {
11
        if (this.drawCloseTicks != that.drawCloseTicks) {
12
            return false;
12
            return false;
13
        }
13
        }
14
        if (!PaintUtilities.equal(this.paint, that.paint)) {
14
        if (!PaintUtilities.equal(this.openTickPaint, that.openTickPaint)) {
15
            return false;
15
            return false;
16
        }
16
        }
17
        if (this.radius != that.radius) {
17
        if (!PaintUtilities.equal(this.closeTickPaint, that.closeTickPaint)) {
18
            return false;
18
            return false;
19
        }
19
        }
20
        if (this.angle != that.angle) {
20
        if (this.tickLength != that.tickLength) {
21
            return false;
21
            return false;
22
        }
22
        }
23
        if (!this.anchor.equals(that.anchor)) {
23
        if (!super.equals(obj)) {
24
            return false;
24
            return false;
25
        }
25
        }
26
        return super.equals(obj);
26
        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.4
Clones locationClones are in different classes
Number of node comparisons110
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements13
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)5.8
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    3
    if (!(obj instanceof DialTextAnnotation))
    3
    if (!(obj instanceof DialTextAnnotation))
    3
    if (!(obj instanceof HighLowRenderer))
    Differences
    Expression1Expression2Difference
    org.jfree.chart.plot.dial.DialTextAnnotationorg.jfree.chart.renderer.xy.HighLowRendererSUBCLASS_TYPE_MISMATCH
    3
    if (!(obj instanceof HighLowRenderer))
    4
    return false;
    4
    return false;
    5
    DialTextAnnotation that = (DialTextAnnotation)obj;
    5
    DialTextAnnotation that = (DialTextAnnotation)obj;
    5
    HighLowRenderer that = (HighLowRenderer)obj;
    Differences
    Expression1Expression2Difference
    org.jfree.chart.plot.dial.DialTextAnnotationorg.jfree.chart.renderer.xy.HighLowRendererSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.plot.dial.DialTextAnnotationorg.jfree.chart.renderer.xy.HighLowRendererSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.plot.dial.DialTextAnnotationorg.jfree.chart.renderer.xy.HighLowRendererSUBCLASS_TYPE_MISMATCH
    5
    HighLowRenderer that = (HighLowRenderer)obj;
                                                                                                  
    6
    if (this.drawOpenTicks != that.drawOpenTicks)
    Preondition Violations
    Unmatched statement if(this.drawOpenTicks != that.drawOpenTicks) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    6
    if (this.drawOpenTicks != that.drawOpenTicks)
                                    
    7
    return false;
    Preondition Violations
    Unmatched return false;
    7
    return false;
    6
    if (!this.label.equals(that.label))
    6
    if (!this.label.equals(that.label))
    16
    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
    16
    if (!super.equals(obj))
    7
    return false;
    17
    return false;
    8
    if (!this.font.equals(that.font))
    8
    if (!this.font.equals(that.font))
    10
    if (!PaintUtilities.equal(this.openTickPaint, that.openTickPaint))
    Differences
    Expression1Expression2Difference
    this.font.equals(that.font)PaintUtilities.equal(this.openTickPaint,that.openTickPaint)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.openTickPaint,that.openTickPaint) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10
    if (!PaintUtilities.equal(this.openTickPaint, that.openTickPaint))
    9
    return false;
    11
    return false;
    10
    if (!PaintUtilities.equal(this.paint, that.paint))
    10
    if (!PaintUtilities.equal(this.paint, that.paint))
    12
    if (!PaintUtilities.equal(this.closeTickPaint, that.closeTickPaint))
    Differences
    Expression1Expression2Difference
    paintcloseTickPaintVARIABLE_NAME_MISMATCH
    org.jfree.chart.plot.dial.DialTextAnnotationorg.jfree.chart.renderer.xy.HighLowRendererSUBCLASS_TYPE_MISMATCH
    paintcloseTickPaintVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression that.paint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.closeTickPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    12
    if (!PaintUtilities.equal(this.closeTickPaint, that.closeTickPaint))
    11
    return false;
    13
    return false;
    12
    if (this.radius != that.radius)
    12
    if (this.radius != that.radius)
    14
    if (this.tickLength != that.tickLength)
    Differences
    Expression1Expression2Difference
    radiustickLengthVARIABLE_NAME_MISMATCH
    org.jfree.chart.plot.dial.DialTextAnnotationorg.jfree.chart.renderer.xy.HighLowRendererSUBCLASS_TYPE_MISMATCH
    radiustickLengthVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression that.radius cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.tickLength cannot be parameterized, because it has dependencies to/from statements that will be extracted
    14
    if (this.tickLength != that.tickLength)
    13
    return false;
    15
    return false;
    14
    if (this.angle != that.angle)
    14
    if (this.angle != that.angle)
    8
    if (this.drawCloseTicks != that.drawCloseTicks)
    Differences
    Expression1Expression2Difference
    angledrawCloseTicksVARIABLE_NAME_MISMATCH
    doublebooleanVARIABLE_TYPE_MISMATCH
    org.jfree.chart.plot.dial.DialTextAnnotationorg.jfree.chart.renderer.xy.HighLowRendererSUBCLASS_TYPE_MISMATCH
    angledrawCloseTicksVARIABLE_NAME_MISMATCH
    doublebooleanVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type double of variable this.angle does not match with type boolean of variable this.drawCloseTicks
    Expression that.angle cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.drawCloseTicks 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.drawCloseTicks
    8
    if (this.drawCloseTicks != that.drawCloseTicks)
    15
    return false;
    9
    return false;
    Precondition Violations (16)
    Row Violation
    1Unmatched statement if(this.drawOpenTicks != that.drawOpenTicks) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Unmatched return false;
    3Expression this.label.equals(that.label) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Super method call if(!super.equals(obj)) cannot be extracted from method
    5Expression this.font.equals(that.font) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression PaintUtilities.equal(this.openTickPaint,that.openTickPaint) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression that.paint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Expression that.closeTickPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    9Expression that.radius cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10Expression that.tickLength cannot be parameterized, because it has dependencies to/from statements that will be extracted
    11Type double of variable this.angle does not match with type boolean of variable this.drawCloseTicks
    12Expression that.angle cannot be parameterized, because it has dependencies to/from statements that will be extracted
    13Expression that.drawCloseTicks 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.drawCloseTicks
    15Clone fragment #1 returns variable that with type org.jfree.chart.plot.dial.DialTextAnnotation , while Clone fragment #2 returns variable that with type org.jfree.chart.renderer.xy.HighLowRenderer
    16Not all possible execution flows end in a return statement