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);
if (obj == this) { return true; } if (!(obj instanceof StandardXYItemRenderer)) { return false; } StandardXYItemRenderer that = (StandardXYItemRenderer) obj; if (this.baseShapesVisible != that.baseShapesVisible) { return false; } if (this.plotLines != that.plotLines) { return false; } if (this.plotImages != that.plotImages) { return false; } if (this.plotDiscontinuous != that.plotDiscontinuous) { return false; } if (this.gapThresholdType != that.gapThresholdType) { return false; } if (this.gapThreshold != that.gapThreshold) { return false; } if (!ObjectUtilities.equal(this.shapesFilled, that.shapesFilled)) { return false; } if (!this.seriesShapesFilled.equals(that.seriesShapesFilled)) { return false; } if (this.baseShapesFilled != that.baseShapesFilled) { return false; } if (this.drawSeriesLineAsPath != that.drawSeriesLineAsPath) { return false; } if (!ShapeUtilities.equal(this.legendLine, that.legendLine)) { return false; } return super.equals(obj);
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/xy/CandlestickRenderer.java File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/xy/StandardXYItemRenderer.java
Method name: boolean equals(Object) Method name: boolean equals(Object)
Number of AST nodes: 26 Number of AST nodes: 28
1
if (obj == this) {
1
if (obj == this) {
2
            return true;
2
            return true;
3
        }
3
        }
4
        if (!(obj instanceof CandlestickRenderer)) {
4
        if (!(obj instanceof StandardXYItemRenderer)) {
5
            return false;
5
            return false;
6
        }
6
        }
7
        CandlestickRenderer that = (CandlestickRenderer) obj;
7
        StandardXYItemRenderer that = (StandardXYItemRenderer) obj;
8
        if (this.candleWidth != that.candleWidth) {
8
        if (this.baseShapesVisible != that.baseShapesVisible) {
9
            return false;
9
            return false;
10
        }
10
        }
11
        if (!PaintUtilities.equal(this.upPaint, that.upPaint)
11
        if (this.plotLines != that.plotLines) {
12
            return false;
13
        }
12
) {
14
        if (this.plotImages != that.plotImages) {
13
            return false;
15
            return false;
14
        }
16
        }
15
        if (!PaintUtilities.equal(this.downPaint, that.downPaint)) {
17
        if (this.plotDiscontinuous != that.plotDiscontinuous) {
16
            return false;
18
            return false;
17
        }
19
        }
18
        if (this.drawVolume != that.drawVolume) {
20
        if (this.gapThresholdType != that.gapThresholdType) {
19
            return false;
21
            return false;
20
        }
22
        }
21
        if (this.maxCandleWidthInMilliseconds
23
        if (this.
22
                != that.maxCandleWidthInMilliseconds) {
24
gapThreshold != that.gapThreshold) {
23
            return false;
25
            return false;
24
        }
26
        }
25
        if (this.autoWidthMethod != that.autoWidthMethod) {
27
        if (!ObjectUtilities.equal(this.shapesFilled, that.shapesFilled)) {
26
            return false;
28
            return false;
27
        }
29
        }
28
        if (this.autoWidthFactor != that.autoWidthFactor) {
30
        if (!this.seriesShapesFilled.equals(that.seriesShapesFilled)) {
29
            return false;
31
            return false;
30
        }
32
        }
31
        if (this.autoWidthGap != that.autoWidthGap) {
33
        if (this.baseShapesFilled != that.baseShapesFilled) {
32
            return false;
34
            return false;
33
        }
35
        }
34
        if (this.useOutlinePaint != that.useOutlinePaint) {
36
        if (this.drawSeriesLineAsPath != that.drawSeriesLineAsPath) {
35
            return false;
37
            return false;
36
        }
38
        }
37
        if (!PaintUtilities.equal(this.volumePaint, that.volumePaint)) {
39
        if (!ShapeUtilities.equal(this.legendLine, that.legendLine)) {
38
            return false;
40
            return false;
39
        }
41
        }
40
        return super.equals(obj);
42
        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)23.2
Clones locationClones are in different classes having the same super class
Number of node comparisons298
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements26
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)20.8
    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 CandlestickRenderer))
    3
    if (!(obj instanceof CandlestickRenderer))
    3
    if (!(obj instanceof StandardXYItemRenderer))
    Differences
    Expression1Expression2Difference
    org.jfree.chart.renderer.xy.CandlestickRendererorg.jfree.chart.renderer.xy.StandardXYItemRendererSUBCLASS_TYPE_MISMATCH
    3
    if (!(obj instanceof StandardXYItemRenderer))
    4
    return false;
    4
    return false;
    5
    CandlestickRenderer that = (CandlestickRenderer)obj;
    5
    CandlestickRenderer that = (CandlestickRenderer)obj;
    5
    StandardXYItemRenderer that = (StandardXYItemRenderer)obj;
    Differences
    Expression1Expression2Difference
    org.jfree.chart.renderer.xy.CandlestickRendererorg.jfree.chart.renderer.xy.StandardXYItemRendererSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.renderer.xy.CandlestickRendererorg.jfree.chart.renderer.xy.StandardXYItemRendererSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.renderer.xy.CandlestickRendererorg.jfree.chart.renderer.xy.StandardXYItemRendererSUBCLASS_TYPE_MISMATCH
    5
    StandardXYItemRenderer that = (StandardXYItemRenderer)obj;
                                                                                                                  
    6
    if (this.baseShapesVisible != that.baseShapesVisible)
    Preondition Violations
    Unmatched statement if(this.baseShapesVisible != that.baseShapesVisible) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    6
    if (this.baseShapesVisible != that.baseShapesVisible)
                                    
    7
    return false;
    Preondition Violations
    Unmatched return false;
    7
    return false;
    6
    if (this.candleWidth != that.candleWidth)
    6
    if (this.candleWidth != that.candleWidth)
    16
    if (this.gapThreshold != that.gapThreshold)
    Differences
    Expression1Expression2Difference
    candleWidthgapThresholdVARIABLE_NAME_MISMATCH
    org.jfree.chart.renderer.xy.CandlestickRendererorg.jfree.chart.renderer.xy.StandardXYItemRendererSUBCLASS_TYPE_MISMATCH
    candleWidthgapThresholdVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression that.candleWidth cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.gapThreshold cannot be parameterized, because it has dependencies to/from statements that will be extracted
    16
    if (this.gapThreshold != that.gapThreshold)
    7
    return false;
    17
    return false;
    8
    if (!PaintUtilities.equal(this.upPaint, that.upPaint))
    8
    if (!PaintUtilities.equal(this.upPaint, that.upPaint))
    18
    if (!ObjectUtilities.equal(this.shapesFilled, that.shapesFilled))
    Differences
    Expression1Expression2Difference
    upPaintshapesFilledVARIABLE_NAME_MISMATCH
    java.awt.Paintjava.lang.BooleanVARIABLE_TYPE_MISMATCH
    org.jfree.chart.renderer.xy.CandlestickRendererorg.jfree.chart.renderer.xy.StandardXYItemRendererSUBCLASS_TYPE_MISMATCH
    upPaintshapesFilledVARIABLE_NAME_MISMATCH
    java.awt.Paintjava.lang.BooleanVARIABLE_TYPE_MISMATCH
    org.jfree.util.PaintUtilitiesorg.jfree.util.ObjectUtilitiesVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.awt.Paint of variable this.upPaint does not match with type java.lang.Boolean of variable this.shapesFilled
    • Make classes java.awt.Paint and java.lang.Boolean extend a common superclass
    Expression that.upPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.shapesFilled cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type java.awt.Paint of variable that.upPaint does not match with type java.lang.Boolean of variable that.shapesFilled
    • Make classes java.awt.Paint and java.lang.Boolean extend a common superclass
    Type org.jfree.util.PaintUtilities does not match with type org.jfree.util.ObjectUtilities
    • Make classes org.jfree.util.PaintUtilities and org.jfree.util.ObjectUtilities extend a common superclass
    18
    if (!ObjectUtilities.equal(this.shapesFilled, that.shapesFilled))
    9
    return false;
    19
    return false;
    10
    if (!PaintUtilities.equal(this.downPaint, that.downPaint))
    10
    if (!PaintUtilities.equal(this.downPaint, that.downPaint))
    26
    if (!ShapeUtilities.equal(this.legendLine, that.legendLine))
    Differences
    Expression1Expression2Difference
    downPaintlegendLineVARIABLE_NAME_MISMATCH
    java.awt.Paintjava.awt.ShapeVARIABLE_TYPE_MISMATCH
    org.jfree.chart.renderer.xy.CandlestickRendererorg.jfree.chart.renderer.xy.StandardXYItemRendererSUBCLASS_TYPE_MISMATCH
    downPaintlegendLineVARIABLE_NAME_MISMATCH
    java.awt.Paintjava.awt.ShapeVARIABLE_TYPE_MISMATCH
    org.jfree.util.PaintUtilitiesorg.jfree.util.ShapeUtilitiesVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.awt.Paint of variable this.downPaint does not match with type java.awt.Shape of variable this.legendLine
    • Make classes java.awt.Paint and java.awt.Shape extend a common superclass
    Expression that.downPaint 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 java.awt.Paint of variable that.downPaint does not match with type java.awt.Shape of variable that.legendLine
    • Make classes java.awt.Paint and java.awt.Shape extend a common superclass
    Type org.jfree.util.PaintUtilities does not match with type org.jfree.util.ShapeUtilities
    • Make classes org.jfree.util.PaintUtilities and org.jfree.util.ShapeUtilities extend a common superclass
    26
    if (!ShapeUtilities.equal(this.legendLine, that.legendLine))
    11
    return false;
    27
    return false;
    12
    if (this.drawVolume != that.drawVolume)
    12
    if (this.drawVolume != that.drawVolume)
    12
    if (this.plotDiscontinuous != that.plotDiscontinuous)
    Differences
    Expression1Expression2Difference
    drawVolumeplotDiscontinuousVARIABLE_NAME_MISMATCH
    org.jfree.chart.renderer.xy.CandlestickRendererorg.jfree.chart.renderer.xy.StandardXYItemRendererSUBCLASS_TYPE_MISMATCH
    drawVolumeplotDiscontinuousVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression that.drawVolume cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.plotDiscontinuous cannot be parameterized, because it has dependencies to/from statements that will be extracted
    12
    if (this.plotDiscontinuous != that.plotDiscontinuous)
    13
    return false;
    13
    return false;
    14
    if (this.maxCandleWidthInMilliseconds != that.maxCandleWidthInMilliseconds)
    14
    if (this.maxCandleWidthInMilliseconds != that.maxCandleWidthInMilliseconds)
    14
    if (this.gapThresholdType != that.gapThresholdType)
    Differences
    Expression1Expression2Difference
    maxCandleWidthInMillisecondsgapThresholdTypeVARIABLE_NAME_MISMATCH
    doubleorg.jfree.util.UnitTypeVARIABLE_TYPE_MISMATCH
    org.jfree.chart.renderer.xy.CandlestickRendererorg.jfree.chart.renderer.xy.StandardXYItemRendererSUBCLASS_TYPE_MISMATCH
    maxCandleWidthInMillisecondsgapThresholdTypeVARIABLE_NAME_MISMATCH
    doubleorg.jfree.util.UnitTypeVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type double of variable this.maxCandleWidthInMilliseconds does not match with type org.jfree.util.UnitType of variable this.gapThresholdType
    Expression that.maxCandleWidthInMilliseconds cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.gapThresholdType cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type double of variable that.maxCandleWidthInMilliseconds does not match with type org.jfree.util.UnitType of variable that.gapThresholdType
    14
    if (this.gapThresholdType != that.gapThresholdType)
    15
    return false;
    15
    return false;
    16
    if (this.autoWidthMethod != that.autoWidthMethod)
    16
    if (this.autoWidthMethod != that.autoWidthMethod)
    10
    if (this.plotImages != that.plotImages)
    Differences
    Expression1Expression2Difference
    autoWidthMethodplotImagesVARIABLE_NAME_MISMATCH
    intbooleanVARIABLE_TYPE_MISMATCH
    org.jfree.chart.renderer.xy.CandlestickRendererorg.jfree.chart.renderer.xy.StandardXYItemRendererSUBCLASS_TYPE_MISMATCH
    autoWidthMethodplotImagesVARIABLE_NAME_MISMATCH
    intbooleanVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type int of variable this.autoWidthMethod does not match with type boolean of variable this.plotImages
    Expression that.autoWidthMethod cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.plotImages cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type int of variable that.autoWidthMethod does not match with type boolean of variable that.plotImages
    10
    if (this.plotImages != that.plotImages)
    17
    return false;
    11
    return false;
    18
    if (this.autoWidthFactor != that.autoWidthFactor)
    18
    if (this.autoWidthFactor != that.autoWidthFactor)
    22
    if (this.baseShapesFilled != that.baseShapesFilled)
    Differences
    Expression1Expression2Difference
    autoWidthFactorbaseShapesFilledVARIABLE_NAME_MISMATCH
    doublebooleanVARIABLE_TYPE_MISMATCH
    org.jfree.chart.renderer.xy.CandlestickRendererorg.jfree.chart.renderer.xy.StandardXYItemRendererSUBCLASS_TYPE_MISMATCH
    autoWidthFactorbaseShapesFilledVARIABLE_NAME_MISMATCH
    doublebooleanVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type double of variable this.autoWidthFactor does not match with type boolean of variable this.baseShapesFilled
    Expression that.autoWidthFactor cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.baseShapesFilled cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type double of variable that.autoWidthFactor does not match with type boolean of variable that.baseShapesFilled
    22
    if (this.baseShapesFilled != that.baseShapesFilled)
    19
    return false;
    23
    return false;
    20
    if (this.autoWidthGap != that.autoWidthGap)
    20
    if (this.autoWidthGap != that.autoWidthGap)
    24
    if (this.drawSeriesLineAsPath != that.drawSeriesLineAsPath)
    Differences
    Expression1Expression2Difference
    autoWidthGapdrawSeriesLineAsPathVARIABLE_NAME_MISMATCH
    doublebooleanVARIABLE_TYPE_MISMATCH
    org.jfree.chart.renderer.xy.CandlestickRendererorg.jfree.chart.renderer.xy.StandardXYItemRendererSUBCLASS_TYPE_MISMATCH
    autoWidthGapdrawSeriesLineAsPathVARIABLE_NAME_MISMATCH
    doublebooleanVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type double of variable this.autoWidthGap does not match with type boolean of variable this.drawSeriesLineAsPath
    Expression that.autoWidthGap cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.drawSeriesLineAsPath cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type double of variable that.autoWidthGap does not match with type boolean of variable that.drawSeriesLineAsPath
    24
    if (this.drawSeriesLineAsPath != that.drawSeriesLineAsPath)
    21
    return false;
    25
    return false;
    22
    if (this.useOutlinePaint != that.useOutlinePaint)
    22
    if (this.useOutlinePaint != that.useOutlinePaint)
    8
    if (this.plotLines != that.plotLines)
    Differences
    Expression1Expression2Difference
    useOutlinePaintplotLinesVARIABLE_NAME_MISMATCH
    org.jfree.chart.renderer.xy.CandlestickRendererorg.jfree.chart.renderer.xy.StandardXYItemRendererSUBCLASS_TYPE_MISMATCH
    useOutlinePaintplotLinesVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression that.useOutlinePaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.plotLines cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8
    if (this.plotLines != that.plotLines)
    23
    return false;
    9
    return false;
    24
    if (!PaintUtilities.equal(this.volumePaint, that.volumePaint))
    24
    if (!PaintUtilities.equal(this.volumePaint, that.volumePaint))
    20
    if (!this.seriesShapesFilled.equals(that.seriesShapesFilled))
    Differences
    Expression1Expression2Difference
    PaintUtilities.equal(this.volumePaint,that.volumePaint)this.seriesShapesFilled.equals(that.seriesShapesFilled)TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression PaintUtilities.equal(this.volumePaint,that.volumePaint) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression this.seriesShapesFilled.equals(that.seriesShapesFilled) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    20
    if (!this.seriesShapesFilled.equals(that.seriesShapesFilled))
    25
    return false;
    21
    return false;
    26
    return super.equals(obj);
    26
    return super.equals(obj);
    28
    return super.equals(obj);
    Preondition Violations
    Super method call return super.equals(obj); cannot be extracted from method
    Super method call return super.equals(obj); cannot be extracted from method
    28
    return super.equals(obj);
    Precondition Violations (40)
    Row Violation
    1Unmatched statement if(this.baseShapesVisible != that.baseShapesVisible) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Unmatched return false;
    3Expression that.candleWidth cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression that.gapThreshold cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Type java.awt.Paint of variable this.upPaint does not match with type java.lang.Boolean of variable this.shapesFilled
    6Expression that.upPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression that.shapesFilled cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Type java.awt.Paint of variable that.upPaint does not match with type java.lang.Boolean of variable that.shapesFilled
    9Type org.jfree.util.PaintUtilities does not match with type org.jfree.util.ObjectUtilities
    10Type java.awt.Paint of variable this.downPaint does not match with type java.awt.Shape of variable this.legendLine
    11Expression that.downPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    12Expression that.legendLine cannot be parameterized, because it has dependencies to/from statements that will be extracted
    13Type java.awt.Paint of variable that.downPaint does not match with type java.awt.Shape of variable that.legendLine
    14Type org.jfree.util.PaintUtilities does not match with type org.jfree.util.ShapeUtilities
    15Expression that.drawVolume cannot be parameterized, because it has dependencies to/from statements that will be extracted
    16Expression that.plotDiscontinuous cannot be parameterized, because it has dependencies to/from statements that will be extracted
    17Type double of variable this.maxCandleWidthInMilliseconds does not match with type org.jfree.util.UnitType of variable this.gapThresholdType
    18Expression that.maxCandleWidthInMilliseconds cannot be parameterized, because it has dependencies to/from statements that will be extracted
    19Expression that.gapThresholdType cannot be parameterized, because it has dependencies to/from statements that will be extracted
    20Type double of variable that.maxCandleWidthInMilliseconds does not match with type org.jfree.util.UnitType of variable that.gapThresholdType
    21Type int of variable this.autoWidthMethod does not match with type boolean of variable this.plotImages
    22Expression that.autoWidthMethod cannot be parameterized, because it has dependencies to/from statements that will be extracted
    23Expression that.plotImages cannot be parameterized, because it has dependencies to/from statements that will be extracted
    24Type int of variable that.autoWidthMethod does not match with type boolean of variable that.plotImages
    25Type double of variable this.autoWidthFactor does not match with type boolean of variable this.baseShapesFilled
    26Expression that.autoWidthFactor cannot be parameterized, because it has dependencies to/from statements that will be extracted
    27Expression that.baseShapesFilled cannot be parameterized, because it has dependencies to/from statements that will be extracted
    28Type double of variable that.autoWidthFactor does not match with type boolean of variable that.baseShapesFilled
    29Type double of variable this.autoWidthGap does not match with type boolean of variable this.drawSeriesLineAsPath
    30Expression that.autoWidthGap cannot be parameterized, because it has dependencies to/from statements that will be extracted
    31Expression that.drawSeriesLineAsPath cannot be parameterized, because it has dependencies to/from statements that will be extracted
    32Type double of variable that.autoWidthGap does not match with type boolean of variable that.drawSeriesLineAsPath
    33Expression that.useOutlinePaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    34Expression that.plotLines cannot be parameterized, because it has dependencies to/from statements that will be extracted
    35Expression PaintUtilities.equal(this.volumePaint,that.volumePaint) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    36Expression this.seriesShapesFilled.equals(that.seriesShapesFilled) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    37Super method call return super.equals(obj); cannot be extracted from method
    38Super method call return super.equals(obj); cannot be extracted from method
    39Clone fragment #1 returns variables , while Clone fragment #2 returns variables that
    40Not all possible execution flows end in a return statement