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 (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/plot/MultiplePiePlot.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: 18 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 MultiplePiePlot)) {
4
        if (!(obj instanceof XYDifferenceRenderer)) {
5
            return false;
5
            return false;
6
        }
7
        MultiplePiePlot that = (MultiplePiePlot) obj;
8
        if (this.dataExtractOrder != that.dataExtractOrder
6
   
7
        }
9
) {
8
        if (!super.equals(obj)) {
10
            return false;
9
            return false;   
11
        }
10
        }
12
        if (this.limit != that.limit
11
        XYDifferenceRenderer that = (XYDifferenceRenderer) obj;
13
) {
12
        if (!PaintUtilities.equal(this.positivePaint, that.positivePaint)) {
14
            return false;
13
            return false;   
15
        }
14
        }
16
        if (!this.aggregatedItemsKey.equals(that.aggregatedItemsKey)) {
15
        if (!PaintUtilities.equal(this.negativePaint, that.negativePaint)) {
17
            return false;
16
            return false;   
18
        }
17
        }
19
        if (!PaintUtilities.equal(this.aggregatedItemsPaint,
18
        if (
20
                that.aggregatedItemsPaint)) {
19
this.shapesVisible != that.shapesVisible) {
21
            return false;
20
            return false;   
22
        }
21
        }
23
        if (!ObjectUtilities.equal(this.pieChart, that.pieChart)) {
22
        if (!ShapeUtilities.equal(this.legendLine, that.legendLine)) {
24
            return false;
23
            return false;   
25
        }
24
        }
26
        if (!super.equals(obj)) {
25
        if (this.roundXCoordinates != that.roundXCoordinates) {
27
            return false;
26
            return false;
28
        }
27
        }
29
        return true;
28
        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)6.1
Clones locationClones are in different classes
Number of node comparisons125
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements18
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)7.7
    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 MultiplePiePlot))
    3
    if (!(obj instanceof MultiplePiePlot))
    3
    if (!(obj instanceof XYDifferenceRenderer))
    Differences
    Expression1Expression2Difference
    org.jfree.chart.plot.MultiplePiePlotorg.jfree.chart.renderer.xy.XYDifferenceRendererSUBCLASS_TYPE_MISMATCH
    3
    if (!(obj instanceof XYDifferenceRenderer))
    4
    return false;
    4
    return false;
    5
    MultiplePiePlot that = (MultiplePiePlot)obj;
    5
    MultiplePiePlot that = (MultiplePiePlot)obj;
    7
    XYDifferenceRenderer that = (XYDifferenceRenderer)obj;
    Differences
    Expression1Expression2Difference
    org.jfree.chart.plot.MultiplePiePlotorg.jfree.chart.renderer.xy.XYDifferenceRendererSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.plot.MultiplePiePlotorg.jfree.chart.renderer.xy.XYDifferenceRendererSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.plot.MultiplePiePlotorg.jfree.chart.renderer.xy.XYDifferenceRendererSUBCLASS_TYPE_MISMATCH
    7
    XYDifferenceRenderer that = (XYDifferenceRenderer)obj;
    6
    if (this.dataExtractOrder != that.dataExtractOrder)
    6
    if (this.dataExtractOrder != that.dataExtractOrder)
    12
    if (this.shapesVisible != that.shapesVisible)
    Differences
    Expression1Expression2Difference
    dataExtractOrdershapesVisibleVARIABLE_NAME_MISMATCH
    org.jfree.util.TableOrderbooleanVARIABLE_TYPE_MISMATCH
    org.jfree.chart.plot.MultiplePiePlotorg.jfree.chart.renderer.xy.XYDifferenceRendererSUBCLASS_TYPE_MISMATCH
    dataExtractOrdershapesVisibleVARIABLE_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.shapesVisible
    Expression that.dataExtractOrder cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.shapesVisible 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.shapesVisible
    12
    if (this.shapesVisible != that.shapesVisible)
    7
    return false;
    13
    return false;
    8
    if (this.limit != that.limit)
    8
    if (this.limit != that.limit)
    16
    if (this.roundXCoordinates != that.roundXCoordinates)
    Differences
    Expression1Expression2Difference
    limitroundXCoordinatesVARIABLE_NAME_MISMATCH
    doublebooleanVARIABLE_TYPE_MISMATCH
    org.jfree.chart.plot.MultiplePiePlotorg.jfree.chart.renderer.xy.XYDifferenceRendererSUBCLASS_TYPE_MISMATCH
    limitroundXCoordinatesVARIABLE_NAME_MISMATCH
    doublebooleanVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type double of variable this.limit does not match with type boolean of variable this.roundXCoordinates
    Expression that.limit cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.roundXCoordinates cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type double of variable that.limit does not match with type boolean of variable that.roundXCoordinates
    16
    if (this.roundXCoordinates != that.roundXCoordinates)
    9
    return false;
    17
    return false;
    10
    if (!this.aggregatedItemsKey.equals(that.aggregatedItemsKey))
    10
    if (!this.aggregatedItemsKey.equals(that.aggregatedItemsKey))
    5
    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
    5
    if (!super.equals(obj))
    11
    return false;
    6
    return false;
    12
    if (!PaintUtilities.equal(this.aggregatedItemsPaint, that.aggregatedItemsPaint))
    12
    if (!PaintUtilities.equal(this.aggregatedItemsPaint, that.aggregatedItemsPaint))
    10
    if (!PaintUtilities.equal(this.negativePaint, that.negativePaint))
    Differences
    Expression1Expression2Difference
    aggregatedItemsPaintnegativePaintVARIABLE_NAME_MISMATCH
    org.jfree.chart.plot.MultiplePiePlotorg.jfree.chart.renderer.xy.XYDifferenceRendererSUBCLASS_TYPE_MISMATCH
    aggregatedItemsPaintnegativePaintVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression that.aggregatedItemsPaint 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
    10
    if (!PaintUtilities.equal(this.negativePaint, that.negativePaint))
    13
    return false;
    11
    return false;
    14
    if (!ObjectUtilities.equal(this.pieChart, that.pieChart))
    14
    if (!ObjectUtilities.equal(this.pieChart, that.pieChart))
    14
    if (!ShapeUtilities.equal(this.legendLine, that.legendLine))
    Differences
    Expression1Expression2Difference
    pieChartlegendLineVARIABLE_NAME_MISMATCH
    org.jfree.chart.JFreeChartjava.awt.ShapeVARIABLE_TYPE_MISMATCH
    org.jfree.chart.plot.MultiplePiePlotorg.jfree.chart.renderer.xy.XYDifferenceRendererSUBCLASS_TYPE_MISMATCH
    pieChartlegendLineVARIABLE_NAME_MISMATCH
    org.jfree.chart.JFreeChartjava.awt.ShapeVARIABLE_TYPE_MISMATCH
    org.jfree.util.ObjectUtilitiesorg.jfree.util.ShapeUtilitiesVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jfree.chart.JFreeChart of variable this.pieChart does not match with type java.awt.Shape of variable this.legendLine
    • Make classes org.jfree.chart.JFreeChart and java.awt.Shape extend a common superclass
    Expression that.pieChart 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.JFreeChart of variable that.pieChart does not match with type java.awt.Shape of variable that.legendLine
    • Make classes org.jfree.chart.JFreeChart 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))
    15
    return false;
    15
    return false;
    16
    if (!super.equals(obj))
    16
    if (!super.equals(obj))
    8
    if (!PaintUtilities.equal(this.positivePaint, that.positivePaint))
    Differences
    Expression1Expression2Difference
    super.equals(obj)PaintUtilities.equal(this.positivePaint,that.positivePaint)TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression PaintUtilities.equal(this.positivePaint,that.positivePaint) 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
    8
    if (!PaintUtilities.equal(this.positivePaint, that.positivePaint))
    17
    return false;
    9
    return false;
    18
    return true;
    18
    return true;
    Precondition Violations (20)
    Row Violation
    1Type org.jfree.util.TableOrder of variable this.dataExtractOrder does not match with type boolean of variable this.shapesVisible
    2Expression that.dataExtractOrder cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression that.shapesVisible 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.shapesVisible
    5Type double of variable this.limit does not match with type boolean of variable this.roundXCoordinates
    6Expression that.limit cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression that.roundXCoordinates cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Type double of variable that.limit does not match with type boolean of variable that.roundXCoordinates
    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.negativePaint 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.Shape of variable this.legendLine
    14Expression that.pieChart cannot be parameterized, because it has dependencies to/from statements that will be extracted
    15Expression that.legendLine 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.Shape of variable that.legendLine
    17Type org.jfree.util.ObjectUtilities does not match with type org.jfree.util.ShapeUtilities
    18Expression PaintUtilities.equal(this.positivePaint,that.positivePaint) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    19Super method call if(!super.equals(obj)) cannot be extracted from method
    20The refactoring of the clones is infeasible, because classes org.jfree.chart.plot.MultiplePiePlot and org.jfree.chart.renderer.xy.XYDifferenceRenderer do not have a common superclass