if (obj == this) { return true; } if (!(obj instanceof DefaultDrawingSupplier)) { return false; } DefaultDrawingSupplier that = (DefaultDrawingSupplier) obj; if (!Arrays.equals(this.paintSequence, that.paintSequence)) { return false; } if (this.paintIndex != that.paintIndex) { return false; } if (!Arrays.equals(this.outlinePaintSequence, that.outlinePaintSequence)) { return false; } if (this.outlinePaintIndex != that.outlinePaintIndex) { return false; } if (!Arrays.equals(this.strokeSequence, that.strokeSequence)) { return false; } if (this.strokeIndex != that.strokeIndex) { return false; } if (!Arrays.equals(this.outlineStrokeSequence, that.outlineStrokeSequence)) { return false; } if (this.outlineStrokeIndex != that.outlineStrokeIndex) { return false; } if (!equalShapes(this.shapeSequence, that.shapeSequence)) { return false; } if (this.shapeIndex != that.shapeIndex) { return false; } return true;
if (obj == this) { return true; } if (!(obj instanceof CandlestickRenderer)) { return false; } CandlestickRenderer that = (CandlestickRenderer) obj; if (this.candleWidth != that.candleWidth) { return false; } if (!PaintUtilities.equal(this.upPaint, that.upPaint)) { return false; } if (!PaintUtilities.equal(this.downPaint, that.downPaint)) { return false; } if (this.drawVolume != that.drawVolume) { return false; } if (this.maxCandleWidthInMilliseconds != that.maxCandleWidthInMilliseconds) { return false; } if (this.autoWidthMethod != that.autoWidthMethod) { return false; } if (this.autoWidthFactor != that.autoWidthFactor) { return false; } if (this.autoWidthGap != that.autoWidthGap) { return false; } if (this.useOutlinePaint != that.useOutlinePaint) { return false; } if (!PaintUtilities.equal(this.volumePaint, that.volumePaint)) { return false; } return super.equals(obj);
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/DefaultDrawingSupplier.java File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/xy/CandlestickRenderer.java
Method name: boolean equals(Object) Method name: boolean equals(Object)
Number of AST nodes: 26 Number of AST nodes: 26
1
if (obj == this) {
1
if (obj == this) {
2
            return true;
2
            return true;
3
        }
3
        }
4
        if (!(obj instanceof DefaultDrawingSupplier)) {
4
        if (!(obj instanceof CandlestickRenderer)) {
5
            return false;
5
            return false;
6
        }
6
        }
7
        DefaultDrawingSupplier that = (DefaultDrawingSupplier) obj;
7
        CandlestickRenderer that = (CandlestickRenderer) obj;
8
        if (!Arrays.equals(this.paintSequence, that.paintSequence)) {
8
        if (this.candleWidth != that.candleWidth) {
9
            return false;
9
            return false;
10
        }
10
        }
11
        if (this.paintIndex != that.paintIndex) {
11
        if (!PaintUtilities.equal(this.upPaint, that.upPaint)) {
12
            return false;   
12
            return false;
13
        }
13
        }
14
        if (!Arrays.equals(this.outlinePaintSequence, 
14
        if (!PaintUtilities.equal(this.
15
                that.outlinePaintSequence)) {
15
downPaint, that.downPaint)) {
16
            return false;
16
            return false;
17
        }
17
        }
18
        if (this.outlinePaintIndex != that.outlinePaintIndex) {
18
        if (this.drawVolume != that.drawVolume) {
19
            return false;
19
            return false;
20
        }
20
        }
21
        if (!Arrays.equals(this.strokeSequence, that.strokeSequence)
21
        if (this.maxCandleWidthInMilliseconds
22
) {
22
                != that.maxCandleWidthInMilliseconds) {
23
            return false;
23
            return false;
24
        }
24
        }
25
        if (this.strokeIndex != that.strokeIndex) {
25
        if (this.autoWidthMethod != that.autoWidthMethod) {
26
            return false;   
26
            return false;
27
        }
27
        }
28
        if (!Arrays.equals(this.outlineStrokeSequence, 
28
        if (this.aut
29
                that.outlineStrokeSequence)) {
29
oWidthFactor != that.autoWidthFactor) {
30
            return false;
30
            return false;
31
        }
31
        }
32
        if (this.outlineStrokeIndex != that.outlineStrokeIndex) {
32
        if (this.autoWidthGap != that.autoWidthGap) {
33
            return false;   
33
            return false;
34
        }
34
        }
35
        if (!equalShapes(this.shapeSequence, that.shapeSequence)) {
35
        if (this.useOutlinePaint != that.useOutlinePaint) {
36
            return false;
36
            return false;
37
        }
37
        }
38
        if (this.shapeIndex != that.shapeIndex) {
38
        if (!PaintUtilities.equal(this.volumePaint, that.volumePaint)) {
39
            return false;
39
            return false;
40
        }
40
        }
41
        return true;
41
        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)15.4
Clones locationClones are in different classes
Number of node comparisons208
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements17
    Number of unmapped statements in the first code fragment8
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)12.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 DefaultDrawingSupplier))
    3
    if (!(obj instanceof DefaultDrawingSupplier))
    3
    if (!(obj instanceof CandlestickRenderer))
    Differences
    Expression1Expression2Difference
    org.jfree.chart.plot.DefaultDrawingSupplierorg.jfree.chart.renderer.xy.CandlestickRendererSUBCLASS_TYPE_MISMATCH
    3
    if (!(obj instanceof CandlestickRenderer))
    4
    return false;
    4
    return false;
    5
    DefaultDrawingSupplier that = (DefaultDrawingSupplier)obj;
    5
    DefaultDrawingSupplier that = (DefaultDrawingSupplier)obj;
    5
    CandlestickRenderer that = (CandlestickRenderer)obj;
    Differences
    Expression1Expression2Difference
    org.jfree.chart.plot.DefaultDrawingSupplierorg.jfree.chart.renderer.xy.CandlestickRendererSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.plot.DefaultDrawingSupplierorg.jfree.chart.renderer.xy.CandlestickRendererSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.plot.DefaultDrawingSupplierorg.jfree.chart.renderer.xy.CandlestickRendererSUBCLASS_TYPE_MISMATCH
    5
    CandlestickRenderer that = (CandlestickRenderer)obj;
    6
    if (!Arrays.equals(this.paintSequence, that.paintSequence))
    6
    if (!Arrays.equals(this.paintSequence, that.paintSequence))
    Preondition Violations
    Unmatched statement if(!Arrays.equals(this.paintSequence,that.paintSequence)) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                                                            
    7
    return false;
    7
    return false;
    Preondition Violations
    Unmatched return false;
                                    
                                                                                                                  
    8
    if (!PaintUtilities.equal(this.upPaint, that.upPaint))
    Preondition Violations
    Unmatched statement if(!PaintUtilities.equal(this.upPaint,that.upPaint)) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    8
    if (!PaintUtilities.equal(this.upPaint, that.upPaint))
                                    
    9
    return false;
    Preondition Violations
    Unmatched return false;
    9
    return false;
    8
    if (this.paintIndex != that.paintIndex)
    8
    if (this.paintIndex != that.paintIndex)
    16
    if (this.autoWidthMethod != that.autoWidthMethod)
    Differences
    Expression1Expression2Difference
    paintIndexautoWidthMethodVARIABLE_NAME_MISMATCH
    org.jfree.chart.plot.DefaultDrawingSupplierorg.jfree.chart.renderer.xy.CandlestickRendererSUBCLASS_TYPE_MISMATCH
    paintIndexautoWidthMethodVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression that.paintIndex cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.autoWidthMethod cannot be parameterized, because it has dependencies to/from statements that will be extracted
    16
    if (this.autoWidthMethod != that.autoWidthMethod)
    9
    return false;
    17
    return false;
    10
    if (!Arrays.equals(this.outlinePaintSequence, that.outlinePaintSequence))
    10
    if (!Arrays.equals(this.outlinePaintSequence, that.outlinePaintSequence))
    Preondition Violations
    Unmatched statement if(!Arrays.equals(this.outlinePaintSequence,that.outlinePaintSequence)) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                                                                                          
    11
    return false;
    11
    return false;
    Preondition Violations
    Unmatched return false;
                                      
    12
    if (this.outlinePaintIndex != that.outlinePaintIndex)
    12
    if (this.outlinePaintIndex != that.outlinePaintIndex)
    12
    if (this.drawVolume != that.drawVolume)
    Differences
    Expression1Expression2Difference
    outlinePaintIndexdrawVolumeVARIABLE_NAME_MISMATCH
    intbooleanVARIABLE_TYPE_MISMATCH
    org.jfree.chart.plot.DefaultDrawingSupplierorg.jfree.chart.renderer.xy.CandlestickRendererSUBCLASS_TYPE_MISMATCH
    outlinePaintIndexdrawVolumeVARIABLE_NAME_MISMATCH
    intbooleanVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type int of variable this.outlinePaintIndex does not match with type boolean of variable this.drawVolume
    Expression that.outlinePaintIndex cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.drawVolume cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type int of variable that.outlinePaintIndex does not match with type boolean of variable that.drawVolume
    12
    if (this.drawVolume != that.drawVolume)
    13
    return false;
    13
    return false;
    14
    if (!Arrays.equals(this.strokeSequence, that.strokeSequence))
    14
    if (!Arrays.equals(this.strokeSequence, that.strokeSequence))
    Preondition Violations
    Unmatched statement if(!Arrays.equals(this.strokeSequence,that.strokeSequence)) 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 (this.strokeIndex != that.strokeIndex)
    16
    if (this.strokeIndex != that.strokeIndex)
    18
    if (this.autoWidthFactor != that.autoWidthFactor)
    Differences
    Expression1Expression2Difference
    strokeIndexautoWidthFactorVARIABLE_NAME_MISMATCH
    intdoubleVARIABLE_TYPE_MISMATCH
    org.jfree.chart.plot.DefaultDrawingSupplierorg.jfree.chart.renderer.xy.CandlestickRendererSUBCLASS_TYPE_MISMATCH
    strokeIndexautoWidthFactorVARIABLE_NAME_MISMATCH
    intdoubleVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type int of variable this.strokeIndex does not match with type double of variable this.autoWidthFactor
    Expression that.strokeIndex cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.autoWidthFactor cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type int of variable that.strokeIndex does not match with type double of variable that.autoWidthFactor
    18
    if (this.autoWidthFactor != that.autoWidthFactor)
    17
    return false;
    19
    return false;
    18
    if (!Arrays.equals(this.outlineStrokeSequence, that.outlineStrokeSequence))
    18
    if (!Arrays.equals(this.outlineStrokeSequence, that.outlineStrokeSequence))
    Preondition Violations
    Unmatched statement if(!Arrays.equals(this.outlineStrokeSequence,that.outlineStrokeSequence)) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                                                                                              
    19
    return false;
    19
    return false;
    Preondition Violations
    Unmatched return false;
                                      
    20
    if (this.outlineStrokeIndex != that.outlineStrokeIndex)
    20
    if (this.outlineStrokeIndex != that.outlineStrokeIndex)
    14
    if (this.maxCandleWidthInMilliseconds != that.maxCandleWidthInMilliseconds)
    Differences
    Expression1Expression2Difference
    outlineStrokeIndexmaxCandleWidthInMillisecondsVARIABLE_NAME_MISMATCH
    intdoubleVARIABLE_TYPE_MISMATCH
    org.jfree.chart.plot.DefaultDrawingSupplierorg.jfree.chart.renderer.xy.CandlestickRendererSUBCLASS_TYPE_MISMATCH
    outlineStrokeIndexmaxCandleWidthInMillisecondsVARIABLE_NAME_MISMATCH
    intdoubleVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type int of variable this.outlineStrokeIndex does not match with type double of variable this.maxCandleWidthInMilliseconds
    Expression that.outlineStrokeIndex cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.maxCandleWidthInMilliseconds cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type int of variable that.outlineStrokeIndex does not match with type double of variable that.maxCandleWidthInMilliseconds
    14
    if (this.maxCandleWidthInMilliseconds != that.maxCandleWidthInMilliseconds)
    21
    return false;
    15
    return false;
    22
    if (!equalShapes(this.shapeSequence, that.shapeSequence))
    22
    if (!equalShapes(this.shapeSequence, that.shapeSequence))
    10
    if (!PaintUtilities.equal(this.downPaint, that.downPaint))
    Differences
    Expression1Expression2Difference
    equalShapes(this.shapeSequence,that.shapeSequence)PaintUtilities.equal(this.downPaint,that.downPaint)TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression equalShapes(this.shapeSequence,that.shapeSequence) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    • Inline private method equalShapes
    Expression PaintUtilities.equal(this.downPaint,that.downPaint) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10
    if (!PaintUtilities.equal(this.downPaint, that.downPaint))
    23
    return false;
    11
    return false;
    24
    if (this.shapeIndex != that.shapeIndex)
    24
    if (this.shapeIndex != that.shapeIndex)
    6
    if (this.candleWidth != that.candleWidth)
    Differences
    Expression1Expression2Difference
    shapeIndexcandleWidthVARIABLE_NAME_MISMATCH
    intdoubleVARIABLE_TYPE_MISMATCH
    org.jfree.chart.plot.DefaultDrawingSupplierorg.jfree.chart.renderer.xy.CandlestickRendererSUBCLASS_TYPE_MISMATCH
    shapeIndexcandleWidthVARIABLE_NAME_MISMATCH
    intdoubleVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type int of variable this.shapeIndex does not match with type double of variable this.candleWidth
    Expression that.shapeIndex cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.candleWidth cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type int of variable that.shapeIndex does not match with type double of variable that.candleWidth
    6
    if (this.candleWidth != that.candleWidth)
    25
    return false;
    7
    return false;
    Precondition Violations (33)
    Row Violation
    1Unmatched statement if(!Arrays.equals(this.paintSequence,that.paintSequence)) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Unmatched return false;
    3Unmatched statement if(!PaintUtilities.equal(this.upPaint,that.upPaint)) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    4Unmatched return false;
    5Expression that.paintIndex cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression that.autoWidthMethod cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Unmatched statement if(!Arrays.equals(this.outlinePaintSequence,that.outlinePaintSequence)) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    8Unmatched return false;
    9Type int of variable this.outlinePaintIndex does not match with type boolean of variable this.drawVolume
    10Expression that.outlinePaintIndex cannot be parameterized, because it has dependencies to/from statements that will be extracted
    11Expression that.drawVolume cannot be parameterized, because it has dependencies to/from statements that will be extracted
    12Type int of variable that.outlinePaintIndex does not match with type boolean of variable that.drawVolume
    13Unmatched statement if(!Arrays.equals(this.strokeSequence,that.strokeSequence)) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    14Unmatched return false;
    15Type int of variable this.strokeIndex does not match with type double of variable this.autoWidthFactor
    16Expression that.strokeIndex cannot be parameterized, because it has dependencies to/from statements that will be extracted
    17Expression that.autoWidthFactor cannot be parameterized, because it has dependencies to/from statements that will be extracted
    18Type int of variable that.strokeIndex does not match with type double of variable that.autoWidthFactor
    19Unmatched statement if(!Arrays.equals(this.outlineStrokeSequence,that.outlineStrokeSequence)) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    20Unmatched return false;
    21Type int of variable this.outlineStrokeIndex does not match with type double of variable this.maxCandleWidthInMilliseconds
    22Expression that.outlineStrokeIndex cannot be parameterized, because it has dependencies to/from statements that will be extracted
    23Expression that.maxCandleWidthInMilliseconds cannot be parameterized, because it has dependencies to/from statements that will be extracted
    24Type int of variable that.outlineStrokeIndex does not match with type double of variable that.maxCandleWidthInMilliseconds
    25Expression equalShapes(this.shapeSequence,that.shapeSequence) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    26Expression PaintUtilities.equal(this.downPaint,that.downPaint) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    27Type int of variable this.shapeIndex does not match with type double of variable this.candleWidth
    28Expression that.shapeIndex cannot be parameterized, because it has dependencies to/from statements that will be extracted
    29Expression that.candleWidth cannot be parameterized, because it has dependencies to/from statements that will be extracted
    30Type int of variable that.shapeIndex does not match with type double of variable that.candleWidth
    31Clone fragment #1 returns variable that with type org.jfree.chart.plot.DefaultDrawingSupplier , while Clone fragment #2 returns variable that with type org.jfree.chart.renderer.xy.CandlestickRenderer
    32Not all possible execution flows end in a return statement
    33The refactoring of the clones is infeasible, because classes org.jfree.chart.plot.DefaultDrawingSupplier and org.jfree.chart.renderer.xy.CandlestickRenderer do not have a common superclass