if (obj == this) { return true; } if (!(obj instanceof MultiplePiePlot)) { return false; } MultiplePiePlot that = (MultiplePiePlot) obj; if (this.dataExtractOrder != that.dataExtractOrder) { return false; } if (this.limit != that.limit) { return false; } if (!this.aggregatedItemsKey.equals(that.aggregatedItemsKey)) { return false; } if (!PaintUtilities.equal(this.aggregatedItemsPaint, that.aggregatedItemsPaint)) { return false; } if (!ObjectUtilities.equal(this.pieChart, that.pieChart)) { return false; } if (!super.equals(obj)) { return false; } return true;
if (this == obj) { return true; } if (!(obj instanceof HighLowRenderer)) { return false; } HighLowRenderer that = (HighLowRenderer) obj; if (this.drawOpenTicks != that.drawOpenTicks) { return false; } if (this.drawCloseTicks != that.drawCloseTicks) { return false; } if (!PaintUtilities.equal(this.openTickPaint, that.openTickPaint)) { return false; } if (!PaintUtilities.equal(this.closeTickPaint, that.closeTickPaint)) { return false; } if (this.tickLength != that.tickLength) { return false; } if (!super.equals(obj)) { return false; } return true;
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/MultiplePiePlot.java File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/xy/HighLowRenderer.java
Method name: boolean equals(Object) Method name: boolean equals(Object)
Number of AST nodes: 18 Number of AST nodes: 18
1
if (obj == this) {
1
if (this == obj) {
2
            return true;
2
            return true;
3
        }
3
        }
4
        if (!(obj instanceof MultiplePiePlot)) {
4
        if (!(obj instanceof HighLowRenderer)) {
5
            return false;
5
            return false;
6
        }
6
        }
7
        MultiplePiePlot that = (MultiplePiePlot) obj;
7
        HighLowRenderer that = (HighLowRenderer) obj;
8
        if (this.dataExtractOrder != that.dataExtractOrder) {
8
        if (this.drawOpenTicks != that.drawOpenTicks) {
9
            return false;
9
            return false;
10
        }
10
        }
11
        if (this.limit != that.limit) {
11
        if (this.drawCloseTicks != that.drawCloseTicks) {
12
            return false;
12
            return false;
13
        }
13
        }
14
        if (!this.aggregatedItemsKey.equals(that.aggregatedItemsKey)) {
14
        if (!PaintUtilities.equal(this.openTickPaint, that.openTickPaint)) {
15
            return false;
15
            return false;
16
        }
16
        }
17
        if (!PaintUtilities.equal(this.aggregatedItemsPaint,
17
        if (!PaintUtilities.equal(this.
18
                that.aggregatedItemsPaint)) {
18
closeTickPaint, that.closeTickPaint)) {
19
            return false;
19
            return false;
20
        }
20
        }
21
        if (!ObjectUtilities.equal(this.pieChart, that.pieChart)) {
21
        if (this.tickLength != that.tickLength) {
22
            return false;
22
            return false;
23
        }
23
        }
24
        if (!super.equals(obj)) {
24
        if (!super.equals(obj)) {
25
            return false;
25
            return false;
26
        }
26
        }
27
        return true;
27
        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)7.9
Clones locationClones are in different classes
Number of node comparisons110
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements13
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)7.1
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    3
    if (!(obj instanceof MultiplePiePlot))
    3
    if (!(obj instanceof MultiplePiePlot))
    3
    if (!(obj instanceof HighLowRenderer))
    Differences
    Expression1Expression2Difference
    org.jfree.chart.plot.MultiplePiePlotorg.jfree.chart.renderer.xy.HighLowRendererSUBCLASS_TYPE_MISMATCH
    3
    if (!(obj instanceof HighLowRenderer))
    4
    return false;
    4
    return false;
    5
    MultiplePiePlot that = (MultiplePiePlot)obj;
    5
    MultiplePiePlot that = (MultiplePiePlot)obj;
    5
    HighLowRenderer that = (HighLowRenderer)obj;
    Differences
    Expression1Expression2Difference
    org.jfree.chart.plot.MultiplePiePlotorg.jfree.chart.renderer.xy.HighLowRendererSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.plot.MultiplePiePlotorg.jfree.chart.renderer.xy.HighLowRendererSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.plot.MultiplePiePlotorg.jfree.chart.renderer.xy.HighLowRendererSUBCLASS_TYPE_MISMATCH
    5
    HighLowRenderer that = (HighLowRenderer)obj;
    6
    if (this.dataExtractOrder != that.dataExtractOrder)
    6
    if (this.dataExtractOrder != that.dataExtractOrder)
    6
    if (this.drawOpenTicks != that.drawOpenTicks)
    Differences
    Expression1Expression2Difference
    dataExtractOrderdrawOpenTicksVARIABLE_NAME_MISMATCH
    org.jfree.util.TableOrderbooleanVARIABLE_TYPE_MISMATCH
    org.jfree.chart.plot.MultiplePiePlotorg.jfree.chart.renderer.xy.HighLowRendererSUBCLASS_TYPE_MISMATCH
    dataExtractOrderdrawOpenTicksVARIABLE_NAME_MISMATCH
    org.jfree.util.TableOrderbooleanVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jfree.util.TableOrder of variable this.dataExtractOrder does not match with type boolean of variable this.drawOpenTicks
    Expression that.dataExtractOrder cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.drawOpenTicks cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type org.jfree.util.TableOrder of variable that.dataExtractOrder does not match with type boolean of variable that.drawOpenTicks
    6
    if (this.drawOpenTicks != that.drawOpenTicks)
    7
    return false;
    7
    return false;
                                                                                                      
    8
    if (this.drawCloseTicks != that.drawCloseTicks)
    Preondition Violations
    Unmatched statement if(this.drawCloseTicks != that.drawCloseTicks) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    8
    if (this.drawCloseTicks != that.drawCloseTicks)
                                    
    9
    return false;
    Preondition Violations
    Unmatched return false;
    9
    return false;
    8
    if (this.limit != that.limit)
    8
    if (this.limit != that.limit)
    14
    if (this.tickLength != that.tickLength)
    Differences
    Expression1Expression2Difference
    limittickLengthVARIABLE_NAME_MISMATCH
    org.jfree.chart.plot.MultiplePiePlotorg.jfree.chart.renderer.xy.HighLowRendererSUBCLASS_TYPE_MISMATCH
    limittickLengthVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression that.limit cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.tickLength cannot be parameterized, because it has dependencies to/from statements that will be extracted
    14
    if (this.tickLength != that.tickLength)
    9
    return false;
    15
    return false;
    10
    if (!this.aggregatedItemsKey.equals(that.aggregatedItemsKey))
    10
    if (!this.aggregatedItemsKey.equals(that.aggregatedItemsKey))
    16
    if (!super.equals(obj))
    Differences
    Expression1Expression2Difference
    this.aggregatedItemsKey.equals(that.aggregatedItemsKey)super.equals(obj)TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression this.aggregatedItemsKey.equals(that.aggregatedItemsKey) 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
    16
    if (!super.equals(obj))
    11
    return false;
    17
    return false;
    12
    if (!PaintUtilities.equal(this.aggregatedItemsPaint, that.aggregatedItemsPaint))
    12
    if (!PaintUtilities.equal(this.aggregatedItemsPaint, that.aggregatedItemsPaint))
    12
    if (!PaintUtilities.equal(this.closeTickPaint, that.closeTickPaint))
    Differences
    Expression1Expression2Difference
    aggregatedItemsPaintcloseTickPaintVARIABLE_NAME_MISMATCH
    org.jfree.chart.plot.MultiplePiePlotorg.jfree.chart.renderer.xy.HighLowRendererSUBCLASS_TYPE_MISMATCH
    aggregatedItemsPaintcloseTickPaintVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression that.aggregatedItemsPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.closeTickPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    12
    if (!PaintUtilities.equal(this.closeTickPaint, that.closeTickPaint))
    13
    return false;
    13
    return false;
    14
    if (!ObjectUtilities.equal(this.pieChart, that.pieChart))
    14
    if (!ObjectUtilities.equal(this.pieChart, that.pieChart))
    10
    if (!PaintUtilities.equal(this.openTickPaint, that.openTickPaint))
    Differences
    Expression1Expression2Difference
    pieChartopenTickPaintVARIABLE_NAME_MISMATCH
    org.jfree.chart.JFreeChartjava.awt.PaintVARIABLE_TYPE_MISMATCH
    org.jfree.chart.plot.MultiplePiePlotorg.jfree.chart.renderer.xy.HighLowRendererSUBCLASS_TYPE_MISMATCH
    pieChartopenTickPaintVARIABLE_NAME_MISMATCH
    org.jfree.chart.JFreeChartjava.awt.PaintVARIABLE_TYPE_MISMATCH
    org.jfree.util.ObjectUtilitiesorg.jfree.util.PaintUtilitiesVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jfree.chart.JFreeChart of variable this.pieChart does not match with type java.awt.Paint of variable this.openTickPaint
    • Make classes org.jfree.chart.JFreeChart and java.awt.Paint extend a common superclass
    Expression that.pieChart cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.openTickPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type org.jfree.chart.JFreeChart of variable that.pieChart does not match with type java.awt.Paint of variable that.openTickPaint
    • Make classes org.jfree.chart.JFreeChart 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.openTickPaint, that.openTickPaint))
    15
    return false;
    11
    return false;
    Precondition Violations (19)
    Row Violation
    1Type org.jfree.util.TableOrder of variable this.dataExtractOrder does not match with type boolean of variable this.drawOpenTicks
    2Expression that.dataExtractOrder cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression that.drawOpenTicks cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Type org.jfree.util.TableOrder of variable that.dataExtractOrder does not match with type boolean of variable that.drawOpenTicks
    5Unmatched statement if(this.drawCloseTicks != that.drawCloseTicks) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    6Unmatched return false;
    7Expression that.limit cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Expression that.tickLength cannot be parameterized, because it has dependencies to/from statements that will be extracted
    9Expression this.aggregatedItemsKey.equals(that.aggregatedItemsKey) 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.aggregatedItemsPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    12Expression that.closeTickPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    13Type org.jfree.chart.JFreeChart of variable this.pieChart does not match with type java.awt.Paint of variable this.openTickPaint
    14Expression that.pieChart cannot be parameterized, because it has dependencies to/from statements that will be extracted
    15Expression that.openTickPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    16Type org.jfree.chart.JFreeChart of variable that.pieChart does not match with type java.awt.Paint of variable that.openTickPaint
    17Type org.jfree.util.ObjectUtilities does not match with type org.jfree.util.PaintUtilities
    18Clone fragment #1 returns variables , while Clone fragment #2 returns variables that
    19Not all possible execution flows end in a return statement