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 (!super.equals(obj)) { return false; } if (!(obj instanceof WaterfallBarRenderer)) { return false; } WaterfallBarRenderer that = (WaterfallBarRenderer) obj; if (!PaintUtilities.equal(this.firstBarPaint, that.firstBarPaint)) { return false; } if (!PaintUtilities.equal(this.lastBarPaint, that.lastBarPaint)) { return false; } if (!PaintUtilities.equal(this.positiveBarPaint, that.positiveBarPaint)) { return false; } if (!PaintUtilities.equal(this.negativeBarPaint, that.negativeBarPaint)) { 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/category/WaterfallBarRenderer.java
Method name: boolean equals(Object) Method name: boolean equals(Object)
Number of AST nodes: 18 Number of AST nodes: 16
1
if (obj == this) {
1
if (obj == this) {
2
            return true;
2
            return true;
3
        }
3
        }
4
        if (!(obj instanceof MultiplePiePlot)) {
4
        if (!super.equals(obj)) {
5
            return false;
5
            return false;
6
        }
6
        }
7
        MultiplePiePlot that = (MultiplePiePlot) obj;
7
        
8
        if (this.dataExtractOrder != that.dataExtractOrder) {
9
            return false;
10
        }
11
        if (this.limit != that.limit
8
if (!(obj instanceof WaterfallBarRenderer)) {
9
            return false;
10
        }
11
        WaterfallBarRenderer that = (WaterfallBarRenderer) obj;
12
) {
12
        if (!PaintUtilities.equal(this.firstBarPaint, that.firstBarPaint)) {
13
            return false;
13
            return false;
14
        }
14
        }
15
        if (!this.aggregatedItemsKey.equals(that.aggregatedItemsKey)) {
15
        if (!PaintUtilities.equal(this.lastBarPaint, that.lastBarPaint)) {
16
            return false;
16
            return false;
17
        }
17
        }
18
        if (!PaintUtilities.equal(this.aggregatedItemsPaint,
18
        if (!PaintUtilities.equal(this.positiveBarPaint,
19
                that.aggregatedItemsPaint)) {
19
                that.positiveBarPaint)) {
20
            return false;
20
            return false;
21
        }
21
        }
22
        if (!ObjectUtilities.equal(this.pieChart, that.pieChart)) {
22
        if (!PaintUtilities.equal(this.
23
            return false;
23
negativeBarPaint,
24
        }
24
        
25
        if (!super.equals(obj)) {
25
        that.negativeBarPaint)) {
26
            return false;
26
            return false;
27
        }
27
        }
28
        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)5.8
Clones locationClones are in different classes
Number of node comparisons105
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements12
    Number of unmapped statements in the first code fragment5
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)5.3
    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 MultiplePiePlot))
    3
    if (!(obj instanceof MultiplePiePlot))
    5
    if (!(obj instanceof WaterfallBarRenderer))
    Differences
    Expression1Expression2Difference
    org.jfree.chart.plot.MultiplePiePlotorg.jfree.chart.renderer.category.WaterfallBarRendererSUBCLASS_TYPE_MISMATCH
    5
    if (!(obj instanceof WaterfallBarRenderer))
    4
    return false;
    6
    return false;
    5
    MultiplePiePlot that = (MultiplePiePlot)obj;
                                                                                              
    6
    if (this.dataExtractOrder != that.dataExtractOrder)
                                                                                                              
    7
    return false;
    7
    return false;
    Preondition Violations
    Unmatched return false;
                                    
    8
    if (this.limit != that.limit)
                                                                  
    9
    return false;
    9
    return false;
    Preondition Violations
    Unmatched return false;
                                    
    10
    if (!this.aggregatedItemsKey.equals(that.aggregatedItemsKey))
    10
    if (!this.aggregatedItemsKey.equals(that.aggregatedItemsKey))
    3
    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
    3
    if (!super.equals(obj))
    11
    return false;
    4
    return false;
                                                                                                                  
    7
    WaterfallBarRenderer that = (WaterfallBarRenderer)obj;
    12
    if (!PaintUtilities.equal(this.aggregatedItemsPaint, that.aggregatedItemsPaint))
    12
    if (!PaintUtilities.equal(this.aggregatedItemsPaint, that.aggregatedItemsPaint))
    12
    if (!PaintUtilities.equal(this.positiveBarPaint, that.positiveBarPaint))
    Differences
    Expression1Expression2Difference
    aggregatedItemsPaintpositiveBarPaintVARIABLE_NAME_MISMATCH
    org.jfree.chart.plot.MultiplePiePlotorg.jfree.chart.renderer.category.WaterfallBarRendererSUBCLASS_TYPE_MISMATCH
    aggregatedItemsPaintpositiveBarPaintVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression that.aggregatedItemsPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.positiveBarPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    12
    if (!PaintUtilities.equal(this.positiveBarPaint, that.positiveBarPaint))
    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.lastBarPaint, that.lastBarPaint))
    Differences
    Expression1Expression2Difference
    pieChartlastBarPaintVARIABLE_NAME_MISMATCH
    org.jfree.chart.JFreeChartjava.awt.PaintVARIABLE_TYPE_MISMATCH
    org.jfree.chart.plot.MultiplePiePlotorg.jfree.chart.renderer.category.WaterfallBarRendererSUBCLASS_TYPE_MISMATCH
    pieChartlastBarPaintVARIABLE_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.lastBarPaint
    • 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.lastBarPaint 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.lastBarPaint
    • 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.lastBarPaint, that.lastBarPaint))
    15
    return false;
    11
    return false;
    16
    if (!super.equals(obj))
    16
    if (!super.equals(obj))
    8
    if (!PaintUtilities.equal(this.firstBarPaint, that.firstBarPaint))
    Differences
    Expression1Expression2Difference
    super.equals(obj)PaintUtilities.equal(this.firstBarPaint,that.firstBarPaint)TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression PaintUtilities.equal(this.firstBarPaint,that.firstBarPaint) 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.firstBarPaint, that.firstBarPaint))
    17
    return false;
    9
    return false;
    Precondition Violations (15)
    Row Violation
    1Unmatched return false;
    2Unmatched return false;
    3Expression this.aggregatedItemsKey.equals(that.aggregatedItemsKey) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Super method call if(!super.equals(obj)) cannot be extracted from method
    5Expression that.aggregatedItemsPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression that.positiveBarPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Type org.jfree.chart.JFreeChart of variable this.pieChart does not match with type java.awt.Paint of variable this.lastBarPaint
    8Expression that.pieChart cannot be parameterized, because it has dependencies to/from statements that will be extracted
    9Expression that.lastBarPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10Type org.jfree.chart.JFreeChart of variable that.pieChart does not match with type java.awt.Paint of variable that.lastBarPaint
    11Type org.jfree.util.ObjectUtilities does not match with type org.jfree.util.PaintUtilities
    12Expression PaintUtilities.equal(this.firstBarPaint,that.firstBarPaint) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    13Super method call if(!super.equals(obj)) cannot be extracted from method
    14Not all possible execution flows end in a return statement
    15The refactoring of the clones is infeasible, because classes org.jfree.chart.plot.MultiplePiePlot and org.jfree.chart.renderer.category.WaterfallBarRenderer do not have a common superclass