if (obj == this) { return true; } if (!(obj instanceof DialPlot)) { return false; } DialPlot that = (DialPlot) obj; if (!ObjectUtilities.equal(this.background, that.background)) { return false; } if (!ObjectUtilities.equal(this.cap, that.cap)) { return false; } if (!this.dialFrame.equals(that.dialFrame)) { return false; } if (this.viewX != that.viewX) { return false; } if (this.viewY != that.viewY) { return false; } if (this.viewW != that.viewW) { return false; } if (this.viewH != that.viewH) { return false; } if (!this.layers.equals(that.layers)) { return false; } if (!this.pointers.equals(that.pointers)) { return false; } return super.equals(obj);
if (obj == this) { return true; } if (!(obj instanceof XYBarRenderer)) { return false; } if (!super.equals(obj)) { return false; } XYBarRenderer that = (XYBarRenderer) obj; if (this.base != that.base) { return false; } if (this.drawBarOutline != that.drawBarOutline) { return false; } if (this.margin != that.margin) { return false; } if (this.useYInterval != that.useYInterval) { return false; } if (!ObjectUtilities.equal( this.gradientPaintTransformer, that.gradientPaintTransformer) ) { return false; } if (!ShapeUtilities.equal(this.legendBar, that.legendBar)) { return false; } if (!ObjectUtilities.equal(this.positiveItemLabelPositionFallback, that.positiveItemLabelPositionFallback)) { return false; } if (!ObjectUtilities.equal(this.negativeItemLabelPositionFallback, that.negativeItemLabelPositionFallback)) { return false; } return true;
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/dial/DialPlot.java File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/xy/XYBarRenderer.java
Method name: boolean equals(Object) Method name: boolean equals(Object)
Number of AST nodes: 24 Number of AST nodes: 24
1
if (obj == this) {
1
if (obj == this) {
2
            return true;
2
            return true;
3
        }
3
        }
4
        if (!(obj instanceof DialPlot)) {
4
        if (!(obj instanceof XYBarRenderer)) {
5
            return false;
5
            return false;
6
        }
6
        }
7
        DialPlot that = (DialPlot) obj;
7
        
8
        if (!ObjectUtilities.equal(this.background, that.background)) {
9
            return false;
10
        }
11
        if (!ObjectUtilities.equal(this.cap,
8
if (!super.equals(obj)) {
9
            return false;
10
        }
11
        XYBarRenderer that = (XYBarRenderer) obj;
12
 that.cap)) {
12
        if (this.base != that.base) {
13
            return false;
13
            return false;
14
        }
14
        }
15
        if (!this.dialFrame.equals(that.dialFrame)) {
15
        if (this.drawBarOutline != that.drawBarOutline) {
16
            return false;
16
            return false;
17
        }
17
        }
18
        if (this.viewX != that.viewX) {
18
        if (this.margin != that.margin) {
19
            return false;
19
            return false;
20
        }
20
        }
21
        if (this.viewY != that.viewY) {
21
        if (this.useYInterval != that.useYInterval) {
22
            return false;
22
            return false;
23
        }
23
        }
24
        if (this.viewW != that.viewW
24
        if (!ObjectUtilities.equal(
25
            this.gradientPaintTransformer, that.gradientPaintTransformer)
25
) {
26
        ) {
26
            return false;
27
            return false;
27
        }
28
        }
28
        if (this.viewH != that.viewH) {
29
        if (!ShapeUtilities.equal(this.legendBar, that.legendBar)) {
29
            return false;
30
            return false;   
30
        }
31
        }
31
        if (!this.layers.equals(that.layers
32
        if (!ObjectUtilities.equal(this.positiveItemLabelPositionFallback,
32
)) {
33
                that.positiveItemLabelPositionFallback)) {
33
            return false;
34
            return false;
34
        }
35
        }
35
        if (!this.pointers.equals(that.pointers
36
        if (!ObjectUtilities.equal(this.negativeItemLabelPositionFallback,
36
)) {
37
                that.negativeItemLabelPositionFallback)) {
37
            return false;
38
            return false;
38
        }
39
        }        
39
        return super.equals(obj);
40
        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)12.5
Clones locationClones are in different classes
Number of node comparisons221
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements24
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)16.2
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (obj == this)
    1
    if (obj == this)
    2
    return true;
    2
    return true;
    3
    if (!(obj instanceof DialPlot))
    3
    if (!(obj instanceof DialPlot))
    3
    if (!(obj instanceof XYBarRenderer))
    Differences
    Expression1Expression2Difference
    org.jfree.chart.plot.dial.DialPlotorg.jfree.chart.renderer.xy.XYBarRendererSUBCLASS_TYPE_MISMATCH
    3
    if (!(obj instanceof XYBarRenderer))
    4
    return false;
    4
    return false;
    5
    DialPlot that = (DialPlot)obj;
    5
    DialPlot that = (DialPlot)obj;
    7
    XYBarRenderer that = (XYBarRenderer)obj;
    Differences
    Expression1Expression2Difference
    org.jfree.chart.plot.dial.DialPlotorg.jfree.chart.renderer.xy.XYBarRendererSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.plot.dial.DialPlotorg.jfree.chart.renderer.xy.XYBarRendererSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.plot.dial.DialPlotorg.jfree.chart.renderer.xy.XYBarRendererSUBCLASS_TYPE_MISMATCH
    7
    XYBarRenderer that = (XYBarRenderer)obj;
    6
    if (!ObjectUtilities.equal(this.background, that.background))
    6
    if (!ObjectUtilities.equal(this.background, that.background))
    16
    if (!ObjectUtilities.equal(this.gradientPaintTransformer, that.gradientPaintTransformer))
    Differences
    Expression1Expression2Difference
    backgroundgradientPaintTransformerVARIABLE_NAME_MISMATCH
    org.jfree.chart.plot.dial.DialLayerorg.jfree.ui.GradientPaintTransformerVARIABLE_TYPE_MISMATCH
    org.jfree.chart.plot.dial.DialPlotorg.jfree.chart.renderer.xy.XYBarRendererSUBCLASS_TYPE_MISMATCH
    backgroundgradientPaintTransformerVARIABLE_NAME_MISMATCH
    org.jfree.chart.plot.dial.DialLayerorg.jfree.ui.GradientPaintTransformerVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jfree.chart.plot.dial.DialLayer of variable this.background does not match with type org.jfree.ui.GradientPaintTransformer of variable this.gradientPaintTransformer
    • Make classes org.jfree.chart.plot.dial.DialLayer and org.jfree.ui.GradientPaintTransformer extend a common superclass
    Expression that.background cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.gradientPaintTransformer cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type org.jfree.chart.plot.dial.DialLayer of variable that.background does not match with type org.jfree.ui.GradientPaintTransformer of variable that.gradientPaintTransformer
    • Make classes org.jfree.chart.plot.dial.DialLayer and org.jfree.ui.GradientPaintTransformer extend a common superclass
    16
    if (!ObjectUtilities.equal(this.gradientPaintTransformer, that.gradientPaintTransformer))
    7
    return false;
    17
    return false;
    8
    if (!ObjectUtilities.equal(this.cap, that.cap))
    8
    if (!ObjectUtilities.equal(this.cap, that.cap))
    20
    if (!ObjectUtilities.equal(this.positiveItemLabelPositionFallback, that.positiveItemLabelPositionFallback))
    Differences
    Expression1Expression2Difference
    cappositiveItemLabelPositionFallbackVARIABLE_NAME_MISMATCH
    org.jfree.chart.plot.dial.DialLayerorg.jfree.chart.labels.ItemLabelPositionVARIABLE_TYPE_MISMATCH
    org.jfree.chart.plot.dial.DialPlotorg.jfree.chart.renderer.xy.XYBarRendererSUBCLASS_TYPE_MISMATCH
    cappositiveItemLabelPositionFallbackVARIABLE_NAME_MISMATCH
    org.jfree.chart.plot.dial.DialLayerorg.jfree.chart.labels.ItemLabelPositionVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jfree.chart.plot.dial.DialLayer of variable this.cap does not match with type org.jfree.chart.labels.ItemLabelPosition of variable this.positiveItemLabelPositionFallback
    • Make classes org.jfree.chart.plot.dial.DialLayer and org.jfree.chart.labels.ItemLabelPosition extend a common superclass
    Expression that.cap cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.positiveItemLabelPositionFallback cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type org.jfree.chart.plot.dial.DialLayer of variable that.cap does not match with type org.jfree.chart.labels.ItemLabelPosition of variable that.positiveItemLabelPositionFallback
    • Make classes org.jfree.chart.plot.dial.DialLayer and org.jfree.chart.labels.ItemLabelPosition extend a common superclass
    20
    if (!ObjectUtilities.equal(this.positiveItemLabelPositionFallback, that.positiveItemLabelPositionFallback))
    9
    return false;
    21
    return false;
    10
    if (!this.dialFrame.equals(that.dialFrame))
    10
    if (!this.dialFrame.equals(that.dialFrame))
    5
    if (!super.equals(obj))
    Differences
    Expression1Expression2Difference
    this.dialFrame.equals(that.dialFrame)super.equals(obj)TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression this.dialFrame.equals(that.dialFrame) 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))
    11
    return false;
    6
    return false;
    12
    if (this.viewX != that.viewX)
    12
    if (this.viewX != that.viewX)
    12
    if (this.margin != that.margin)
    Differences
    Expression1Expression2Difference
    viewXmarginVARIABLE_NAME_MISMATCH
    org.jfree.chart.plot.dial.DialPlotorg.jfree.chart.renderer.xy.XYBarRendererSUBCLASS_TYPE_MISMATCH
    viewXmarginVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression that.viewX cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.margin cannot be parameterized, because it has dependencies to/from statements that will be extracted
    12
    if (this.margin != that.margin)
    13
    return false;
    13
    return false;
    14
    if (this.viewY != that.viewY)
    14
    if (this.viewY != that.viewY)
    8
    if (this.base != that.base)
    Differences
    Expression1Expression2Difference
    viewYbaseVARIABLE_NAME_MISMATCH
    org.jfree.chart.plot.dial.DialPlotorg.jfree.chart.renderer.xy.XYBarRendererSUBCLASS_TYPE_MISMATCH
    viewYbaseVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression that.viewY cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.base cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8
    if (this.base != that.base)
    15
    return false;
    9
    return false;
    16
    if (this.viewW != that.viewW)
    16
    if (this.viewW != that.viewW)
    14
    if (this.useYInterval != that.useYInterval)
    Differences
    Expression1Expression2Difference
    viewWuseYIntervalVARIABLE_NAME_MISMATCH
    doublebooleanVARIABLE_TYPE_MISMATCH
    org.jfree.chart.plot.dial.DialPlotorg.jfree.chart.renderer.xy.XYBarRendererSUBCLASS_TYPE_MISMATCH
    viewWuseYIntervalVARIABLE_NAME_MISMATCH
    doublebooleanVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type double of variable this.viewW does not match with type boolean of variable this.useYInterval
    Expression that.viewW cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.useYInterval cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type double of variable that.viewW does not match with type boolean of variable that.useYInterval
    14
    if (this.useYInterval != that.useYInterval)
    17
    return false;
    15
    return false;
    18
    if (this.viewH != that.viewH)
    18
    if (this.viewH != that.viewH)
    10
    if (this.drawBarOutline != that.drawBarOutline)
    Differences
    Expression1Expression2Difference
    viewHdrawBarOutlineVARIABLE_NAME_MISMATCH
    doublebooleanVARIABLE_TYPE_MISMATCH
    org.jfree.chart.plot.dial.DialPlotorg.jfree.chart.renderer.xy.XYBarRendererSUBCLASS_TYPE_MISMATCH
    viewHdrawBarOutlineVARIABLE_NAME_MISMATCH
    doublebooleanVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type double of variable this.viewH does not match with type boolean of variable this.drawBarOutline
    Expression that.viewH cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.drawBarOutline cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type double of variable that.viewH does not match with type boolean of variable that.drawBarOutline
    10
    if (this.drawBarOutline != that.drawBarOutline)
    19
    return false;
    11
    return false;
    20
    if (!this.layers.equals(that.layers))
    20
    if (!this.layers.equals(that.layers))
    18
    if (!ShapeUtilities.equal(this.legendBar, that.legendBar))
    Differences
    Expression1Expression2Difference
    this.layers.equals(that.layers)ShapeUtilities.equal(this.legendBar,that.legendBar)TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression this.layers.equals(that.layers) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression ShapeUtilities.equal(this.legendBar,that.legendBar) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    18
    if (!ShapeUtilities.equal(this.legendBar, that.legendBar))
    21
    return false;
    19
    return false;
    22
    if (!this.pointers.equals(that.pointers))
    22
    if (!this.pointers.equals(that.pointers))
    22
    if (!ObjectUtilities.equal(this.negativeItemLabelPositionFallback, that.negativeItemLabelPositionFallback))
    Differences
    Expression1Expression2Difference
    this.pointers.equals(that.pointers)ObjectUtilities.equal(this.negativeItemLabelPositionFallback,that.negativeItemLabelPositionFallback)TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression this.pointers.equals(that.pointers) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression ObjectUtilities.equal(this.negativeItemLabelPositionFallback,that.negativeItemLabelPositionFallback) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    22
    if (!ObjectUtilities.equal(this.negativeItemLabelPositionFallback, that.negativeItemLabelPositionFallback))
    23
    return false;
    23
    return false;
    24
    return super.equals(obj);
    24
    return super.equals(obj);
    24
    return true;
    Differences
    Expression1Expression2Difference
    super.equals(obj)trueTYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Super method call return super.equals(obj); cannot be extracted from method
    24
    return true;
    Precondition Violations (28)
    Row Violation
    1Type org.jfree.chart.plot.dial.DialLayer of variable this.background does not match with type org.jfree.ui.GradientPaintTransformer of variable this.gradientPaintTransformer
    2Expression that.background cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression that.gradientPaintTransformer cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Type org.jfree.chart.plot.dial.DialLayer of variable that.background does not match with type org.jfree.ui.GradientPaintTransformer of variable that.gradientPaintTransformer
    5Type org.jfree.chart.plot.dial.DialLayer of variable this.cap does not match with type org.jfree.chart.labels.ItemLabelPosition of variable this.positiveItemLabelPositionFallback
    6Expression that.cap cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression that.positiveItemLabelPositionFallback cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Type org.jfree.chart.plot.dial.DialLayer of variable that.cap does not match with type org.jfree.chart.labels.ItemLabelPosition of variable that.positiveItemLabelPositionFallback
    9Expression this.dialFrame.equals(that.dialFrame) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10Super method call if(!super.equals(obj)) cannot be extracted from method
    11Expression that.viewX cannot be parameterized, because it has dependencies to/from statements that will be extracted
    12Expression that.margin cannot be parameterized, because it has dependencies to/from statements that will be extracted
    13Expression that.viewY cannot be parameterized, because it has dependencies to/from statements that will be extracted
    14Expression that.base cannot be parameterized, because it has dependencies to/from statements that will be extracted
    15Type double of variable this.viewW does not match with type boolean of variable this.useYInterval
    16Expression that.viewW cannot be parameterized, because it has dependencies to/from statements that will be extracted
    17Expression that.useYInterval cannot be parameterized, because it has dependencies to/from statements that will be extracted
    18Type double of variable that.viewW does not match with type boolean of variable that.useYInterval
    19Type double of variable this.viewH does not match with type boolean of variable this.drawBarOutline
    20Expression that.viewH cannot be parameterized, because it has dependencies to/from statements that will be extracted
    21Expression that.drawBarOutline cannot be parameterized, because it has dependencies to/from statements that will be extracted
    22Type double of variable that.viewH does not match with type boolean of variable that.drawBarOutline
    23Expression this.layers.equals(that.layers) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    24Expression ShapeUtilities.equal(this.legendBar,that.legendBar) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    25Expression this.pointers.equals(that.pointers) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    26Expression ObjectUtilities.equal(this.negativeItemLabelPositionFallback,that.negativeItemLabelPositionFallback) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    27Super method call return super.equals(obj); cannot be extracted from method
    28The refactoring of the clones is infeasible, because classes org.jfree.chart.plot.dial.DialPlot and org.jfree.chart.renderer.xy.XYBarRenderer do not have a common superclass