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 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/block/BorderArrangement.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: 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 XYDifferenceRenderer)) {
5
            return false;   
6
        }
5
)) {
7
        if (!super.equals(obj)) {
6
            return false;
8
            return false;   
7
        }
9
        }
8
        BorderArrangement that = (BorderArrangement) obj;
10
        XYDifferenceRenderer that = (XYDifferenceRenderer) obj;
9
        if (!ObjectUtilities.equal(this.topBlock, that.topBlock)) {
11
        if (!PaintUtilities.equal(this.positivePaint, that.positivePaint)) {
10
            return false;
12
            return false;   
11
        }
13
        }
12
        if (!ObjectUtilities.equal(this.bottomBlock, that.bottomBlock)) {
14
        if (!PaintUtilities.equal(this.negativePaint, that.negativePaint)) {
13
            return false;
15
            return false;   
14
        }
16
        }
15
        if (!ObjectUtilities.equal(this.leftBlock, that.leftBlock)) {
17
        if (this.shapesVisible != that.shapesVisible) {
16
            return false;
18
            return false;   
17
        }
19
        }
18
        if (!ObjectUtilities.equal(this.rightBlock, that.rightBlock)) {
20
        if (!ShapeUtilities.equal(this.legendLine, that.legendLine)) {
19
            return false;
21
            return false;   
20
        }
22
        }
21
        if (!ObjectUtilities.equal(this.centerBlock, that.centerBlock)) {
23
        if (this.roundXCoordinates != that.roundXCoordinates) {
22
            return false;
24
            return false;
23
        }
25
        }
24
        return true;
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)5.7
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 fragment3
    Time elapsed for statement mapping (ms)5.1
    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 XYDifferenceRenderer))
    Differences
    Expression1Expression2Difference
    org.jfree.chart.block.BorderArrangementorg.jfree.chart.renderer.xy.XYDifferenceRendererVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jfree.chart.block.BorderArrangement does not match with type org.jfree.chart.renderer.xy.XYDifferenceRenderer
    • Make classes org.jfree.chart.block.BorderArrangement and org.jfree.chart.renderer.xy.XYDifferenceRenderer extend a common superclass
    3
    if (!(obj instanceof XYDifferenceRenderer))
    4
    return false;
    4
    return false;
    5
    BorderArrangement that = (BorderArrangement)obj;
                                                                                                      
                                                                                                                  
    7
    XYDifferenceRenderer that = (XYDifferenceRenderer)obj;
    6
    if (!ObjectUtilities.equal(this.topBlock, that.topBlock))
    6
    if (!ObjectUtilities.equal(this.topBlock, that.topBlock))
    8
    if (!PaintUtilities.equal(this.positivePaint, that.positivePaint))
    Differences
    Expression1Expression2Difference
    topBlockpositivePaintVARIABLE_NAME_MISMATCH
    org.jfree.chart.block.Blockjava.awt.PaintVARIABLE_TYPE_MISMATCH
    org.jfree.chart.block.BorderArrangementorg.jfree.chart.renderer.xy.XYDifferenceRendererVARIABLE_TYPE_MISMATCH
    topBlockpositivePaintVARIABLE_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.positivePaint
    • 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.positivePaint
    • Make classes org.jfree.chart.block.BorderArrangement and org.jfree.chart.renderer.xy.XYDifferenceRenderer extend a common superclass
    Expression that.topBlock cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.positivePaint 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.positivePaint
    • 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
    8
    if (!PaintUtilities.equal(this.positivePaint, that.positivePaint))
    7
    return false;
    9
    return false;
    8
    if (!ObjectUtilities.equal(this.bottomBlock, that.bottomBlock))
    8
    if (!ObjectUtilities.equal(this.bottomBlock, that.bottomBlock))
    10
    if (!PaintUtilities.equal(this.negativePaint, that.negativePaint))
    Differences
    Expression1Expression2Difference
    bottomBlocknegativePaintVARIABLE_NAME_MISMATCH
    org.jfree.chart.block.Blockjava.awt.PaintVARIABLE_TYPE_MISMATCH
    org.jfree.chart.block.BorderArrangementorg.jfree.chart.renderer.xy.XYDifferenceRendererVARIABLE_TYPE_MISMATCH
    bottomBlocknegativePaintVARIABLE_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.bottomBlock does not match with type java.awt.Paint of variable this.negativePaint
    • Make classes org.jfree.chart.block.Block and java.awt.Paint extend a common superclass
    Type org.jfree.chart.block.Block of variable that.bottomBlock does not match with type java.awt.Paint of variable that.negativePaint
    • Make classes org.jfree.chart.block.BorderArrangement and org.jfree.chart.renderer.xy.XYDifferenceRenderer extend a common superclass
    Expression that.bottomBlock 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
    Type org.jfree.chart.block.Block of variable that.bottomBlock does not match with type java.awt.Paint of variable that.negativePaint
    • 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.negativePaint, that.negativePaint))
    9
    return false;
    11
    return false;
                                                                                                    
    12
    if (this.shapesVisible != that.shapesVisible)
                                      
    13
    return false;
    Preondition Violations
    Unmatched return false;
    13
    return false;
    10
    if (!ObjectUtilities.equal(this.leftBlock, that.leftBlock))
    10
    if (!ObjectUtilities.equal(this.leftBlock, that.leftBlock))
    14
    if (!ShapeUtilities.equal(this.legendLine, that.legendLine))
    Differences
    Expression1Expression2Difference
    leftBlocklegendLineVARIABLE_NAME_MISMATCH
    org.jfree.chart.block.Blockjava.awt.ShapeVARIABLE_TYPE_MISMATCH
    org.jfree.chart.block.BorderArrangementorg.jfree.chart.renderer.xy.XYDifferenceRendererVARIABLE_TYPE_MISMATCH
    leftBlocklegendLineVARIABLE_NAME_MISMATCH
    org.jfree.chart.block.Blockjava.awt.ShapeVARIABLE_TYPE_MISMATCH
    org.jfree.util.ObjectUtilitiesorg.jfree.util.ShapeUtilitiesVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jfree.chart.block.Block of variable this.leftBlock does not match with type java.awt.Shape of variable this.legendLine
    • Make classes org.jfree.chart.block.Block and java.awt.Shape extend a common superclass
    Type org.jfree.chart.block.Block of variable that.leftBlock does not match with type java.awt.Shape of variable that.legendLine
    • Make classes org.jfree.chart.block.BorderArrangement and org.jfree.chart.renderer.xy.XYDifferenceRenderer extend a common superclass
    Expression that.leftBlock cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.legendLine cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type org.jfree.chart.block.Block of variable that.leftBlock does not match with type java.awt.Shape of variable that.legendLine
    • Make classes org.jfree.chart.block.Block and java.awt.Shape extend a common superclass
    Type org.jfree.util.ObjectUtilities does not match with type org.jfree.util.ShapeUtilities
    • Make classes org.jfree.util.ObjectUtilities and org.jfree.util.ShapeUtilities extend a common superclass
    14
    if (!ShapeUtilities.equal(this.legendLine, that.legendLine))
    11
    return false;
    15
    return false;
    12
    if (!ObjectUtilities.equal(this.rightBlock, that.rightBlock))
    12
    if (!ObjectUtilities.equal(this.rightBlock, that.rightBlock))
    5
    if (!super.equals(obj))
    Differences
    Expression1Expression2Difference
    ObjectUtilities.equal(this.rightBlock,that.rightBlock)super.equals(obj)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
    Super method call if(!super.equals(obj)) cannot be extracted from method
    5
    if (!super.equals(obj))
    13
    return false;
    6
    return false;
    Precondition Violations (24)
    Row Violation
    1Type org.jfree.chart.block.BorderArrangement does not match with type org.jfree.chart.renderer.xy.XYDifferenceRenderer
    2Type org.jfree.chart.block.Block of variable this.topBlock does not match with type java.awt.Paint of variable this.positivePaint
    3Type org.jfree.chart.block.Block of variable that.topBlock does not match with type java.awt.Paint of variable that.positivePaint
    4Expression that.topBlock cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression that.positivePaint 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.positivePaint
    7Type org.jfree.util.ObjectUtilities does not match with type org.jfree.util.PaintUtilities
    8Type org.jfree.chart.block.Block of variable this.bottomBlock does not match with type java.awt.Paint of variable this.negativePaint
    9Type org.jfree.chart.block.Block of variable that.bottomBlock does not match with type java.awt.Paint of variable that.negativePaint
    10Expression that.bottomBlock cannot be parameterized, because it has dependencies to/from statements that will be extracted
    11Expression that.negativePaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    12Type org.jfree.chart.block.Block of variable that.bottomBlock does not match with type java.awt.Paint of variable that.negativePaint
    13Type org.jfree.util.ObjectUtilities does not match with type org.jfree.util.PaintUtilities
    14Unmatched return false;
    15Type org.jfree.chart.block.Block of variable this.leftBlock does not match with type java.awt.Shape of variable this.legendLine
    16Type org.jfree.chart.block.Block of variable that.leftBlock does not match with type java.awt.Shape of variable that.legendLine
    17Expression that.leftBlock cannot be parameterized, because it has dependencies to/from statements that will be extracted
    18Expression that.legendLine cannot be parameterized, because it has dependencies to/from statements that will be extracted
    19Type org.jfree.chart.block.Block of variable that.leftBlock does not match with type java.awt.Shape of variable that.legendLine
    20Type org.jfree.util.ObjectUtilities does not match with type org.jfree.util.ShapeUtilities
    21Expression ObjectUtilities.equal(this.rightBlock,that.rightBlock) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    22Super method call if(!super.equals(obj)) cannot be extracted from method
    23Not all possible execution flows end in a return statement
    24The refactoring of the clones is infeasible, because classes org.jfree.chart.block.BorderArrangement and org.jfree.chart.renderer.xy.XYDifferenceRenderer do not have a common superclass