if (obj == this) { return true; } if (!(obj instanceof BorderArrangement)) { return false; } BorderArrangement that = (BorderArrangement) obj; if (!ObjectUtilities.equal(this.topBlock, that.topBlock)) { return false; } if (!ObjectUtilities.equal(this.bottomBlock, that.bottomBlock)) { return false; } if (!ObjectUtilities.equal(this.leftBlock, that.leftBlock)) { return false; } if (!ObjectUtilities.equal(this.rightBlock, that.rightBlock)) { return false; } if (!ObjectUtilities.equal(this.centerBlock, that.centerBlock)) { return false; } return true;
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);
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/block/BorderArrangement.java File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/dial/DialTextAnnotation.java
Method name: boolean equals(Object) Method name: boolean equals(Object)
Number of AST nodes: 16 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 BorderArrangement)) {
4
        if (!(obj instanceof DialTextAnnotation)) {
5
            return false;
5
            return false;
6
        }
6
        }
7
        BorderArrangement that = (BorderArrangement) obj;
7
        DialTextAnnotation that = (DialTextAnnotation) obj;
8
        if (!ObjectUtilities.equal(this.topBlock, that.topBlock)) {
8
        if (!this.label.equals(that.label)) {
9
            return false;
9
            return false;
10
        }
10
        }
11
        if (!ObjectUtilities.equal(this.bottomBlock, that.bottomBlock)) {
11
        if (!this.font.equals(that.font)) {
12
            return false;
12
            return false;
13
        }
13
        }
14
        if (!ObjectUtilities.equal(this.leftBlock, that.leftBlock)) {
14
        if (!PaintUtilities.equal(this.paint, that.paint)) {
15
            return false;
15
            return false;
16
        }
16
        }
17
        if (!ObjectUtilities.equal(this.rightBlock, that.rightBlock)
17
        if (this.radius != that.radius) {
18
            return false;
19
        }
18
) {
20
        if (this.angle != that.angle) {
19
            return false;
21
            return false;
20
        }
22
        }
21
        if (!ObjectUtilities.equal(this.centerBlock, that.centerBlock)) {
23
        if (!this.anchor.equals(that.anchor)) {
22
            return false;
24
            return false;
23
        }
25
        }
24
        return true;
26
        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)3.6
Clones locationClones are in different classes
Number of node comparisons105
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements12
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment5
    Time elapsed for statement mapping (ms)4.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 BorderArrangement))
    3
    if (!(obj instanceof BorderArrangement))
    3
    if (!(obj instanceof DialTextAnnotation))
    Differences
    Expression1Expression2Difference
    org.jfree.chart.block.BorderArrangementorg.jfree.chart.plot.dial.DialTextAnnotationVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jfree.chart.block.BorderArrangement does not match with type org.jfree.chart.plot.dial.DialTextAnnotation
    • Make classes org.jfree.chart.block.BorderArrangement and org.jfree.chart.plot.dial.DialTextAnnotation extend a common superclass
    3
    if (!(obj instanceof DialTextAnnotation))
    4
    return false;
    4
    return false;
                                                                                                          
    5
    DialTextAnnotation that = (DialTextAnnotation)obj;
    5
    BorderArrangement that = (BorderArrangement)obj;
                                                                                                      
    6
    if (!ObjectUtilities.equal(this.topBlock, that.topBlock))
    6
    if (!ObjectUtilities.equal(this.topBlock, that.topBlock))
    10
    if (!PaintUtilities.equal(this.paint, that.paint))
    Differences
    Expression1Expression2Difference
    topBlockpaintVARIABLE_NAME_MISMATCH
    org.jfree.chart.block.Blockjava.awt.PaintVARIABLE_TYPE_MISMATCH
    org.jfree.chart.block.BorderArrangementorg.jfree.chart.plot.dial.DialTextAnnotationVARIABLE_TYPE_MISMATCH
    topBlockpaintVARIABLE_NAME_MISMATCH
    org.jfree.chart.block.Blockjava.awt.PaintVARIABLE_TYPE_MISMATCH
    org.jfree.util.ObjectUtilitiesorg.jfree.util.PaintUtilitiesVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jfree.chart.block.Block of variable this.topBlock does not match with type java.awt.Paint of variable this.paint
    • Make classes org.jfree.chart.block.Block and java.awt.Paint extend a common superclass
    Type org.jfree.chart.block.Block of variable that.topBlock does not match with type java.awt.Paint of variable that.paint
    • Make classes org.jfree.chart.block.BorderArrangement and org.jfree.chart.plot.dial.DialTextAnnotation extend a common superclass
    Expression that.topBlock cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.paint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type org.jfree.chart.block.Block of variable that.topBlock does not match with type java.awt.Paint of variable that.paint
    • Make classes org.jfree.chart.block.Block 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
    10
    if (!PaintUtilities.equal(this.paint, that.paint))
    7
    return false;
    11
    return false;
    8
    if (!ObjectUtilities.equal(this.bottomBlock, that.bottomBlock))
    8
    if (!ObjectUtilities.equal(this.bottomBlock, that.bottomBlock))
    8
    if (!this.font.equals(that.font))
    Differences
    Expression1Expression2Difference
    ObjectUtilities.equal(this.bottomBlock,that.bottomBlock)this.font.equals(that.font)TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression ObjectUtilities.equal(this.bottomBlock,that.bottomBlock) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression this.font.equals(that.font) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8
    if (!this.font.equals(that.font))
    9
    return false;
    9
    return false;
    10
    if (!ObjectUtilities.equal(this.leftBlock, that.leftBlock))
    10
    if (!ObjectUtilities.equal(this.leftBlock, that.leftBlock))
    6
    if (!this.label.equals(that.label))
    Differences
    Expression1Expression2Difference
    ObjectUtilities.equal(this.leftBlock,that.leftBlock)this.label.equals(that.label)TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression ObjectUtilities.equal(this.leftBlock,that.leftBlock) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression this.label.equals(that.label) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6
    if (!this.label.equals(that.label))
    11
    return false;
    7
    return false;
                                                                        
    12
    if (this.radius != that.radius)
                                      
    13
    return false;
    Preondition Violations
    Unmatched return false;
    13
    return false;
                                                                    
    14
    if (this.angle != that.angle)
                                      
    15
    return false;
    Preondition Violations
    Unmatched return false;
    15
    return false;
    12
    if (!ObjectUtilities.equal(this.rightBlock, that.rightBlock))
    12
    if (!ObjectUtilities.equal(this.rightBlock, that.rightBlock))
    16
    if (!this.anchor.equals(that.anchor))
    Differences
    Expression1Expression2Difference
    ObjectUtilities.equal(this.rightBlock,that.rightBlock)this.anchor.equals(that.anchor)TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression ObjectUtilities.equal(this.rightBlock,that.rightBlock) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression this.anchor.equals(that.anchor) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    16
    if (!this.anchor.equals(that.anchor))
    13
    return false;
    17
    return false;
    Precondition Violations (17)
    Row Violation
    1Type org.jfree.chart.block.BorderArrangement does not match with type org.jfree.chart.plot.dial.DialTextAnnotation
    2Type org.jfree.chart.block.Block of variable this.topBlock does not match with type java.awt.Paint of variable this.paint
    3Type org.jfree.chart.block.Block of variable that.topBlock does not match with type java.awt.Paint of variable that.paint
    4Expression that.topBlock 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
    6Type org.jfree.chart.block.Block of variable that.topBlock does not match with type java.awt.Paint of variable that.paint
    7Type org.jfree.util.ObjectUtilities does not match with type org.jfree.util.PaintUtilities
    8Expression ObjectUtilities.equal(this.bottomBlock,that.bottomBlock) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    9Expression this.font.equals(that.font) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10Expression ObjectUtilities.equal(this.leftBlock,that.leftBlock) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    11Expression this.label.equals(that.label) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    12Unmatched return false;
    13Unmatched return false;
    14Expression ObjectUtilities.equal(this.rightBlock,that.rightBlock) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    15Expression this.anchor.equals(that.anchor) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    16Not all possible execution flows end in a return statement
    17The refactoring of the clones is infeasible, because classes org.jfree.chart.block.BorderArrangement and org.jfree.chart.plot.dial.DialTextAnnotation do not have a common superclass