if (obj == this) { return true; } if (!(obj instanceof MeterInterval)) { return false; } MeterInterval that = (MeterInterval) obj; if (!this.label.equals(that.label)) { return false; } if (!this.range.equals(that.range)) { return false; } if (!PaintUtilities.equal(this.outlinePaint, that.outlinePaint)) { return false; } if (!ObjectUtilities.equal(this.outlineStroke, that.outlineStroke)) { return false; } if (!PaintUtilities.equal(this.backgroundPaint, that.backgroundPaint)) { 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/MeterInterval.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: 16 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 MeterInterval)) {
4
        if (!super.equals(obj)) {
5
            return false;
5
            return false;
6
        }
6
        }
7
        MeterInterval that = (MeterInterval) obj;
7
        
8
        if (!this.label.equals(that.label)) {
9
            return false;
10
        }
8
if (!(obj instanceof WaterfallBarRenderer)) {
9
            return false;
10
        }
11
        WaterfallBarRenderer that = (WaterfallBarRenderer) obj;
11
        if (!this.range.equals(that.range)) {
12
        if (!PaintUtilities.equal(this.firstBarPaint, that.firstBarPaint)) {
12
            return false;
13
            return false;
13
        }
14
        }
14
        if (!PaintUtilities.equal(this.outlinePaint, that.outlinePaint)) {
15
        if (!PaintUtilities.equal(this.lastBarPaint, that.lastBarPaint)) {
15
            return false;
16
            return false;
16
        }
17
        }
17
        if (!ObjectUtilities.equal(this.outlineStroke, that.outlineStroke
18
        if (!PaintUtilities.equal(this.positiveBarPaint,
18
)) {
19
                that.positiveBarPaint)) {
19
            return false;
20
            return false;
20
        }
21
        }
21
        if (!PaintUtilities.equal(this.backgroundPaint, that.background
22
        if (!PaintUtilities.equal(this.negativeBarPaint,
22
Paint)) {
23
                that.negativeBarPaint)) {
23
            return false;
24
            return false;
24
        }
25
        }
25
        return true;
26
        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)4.7
Clones locationClones are in different classes
Number of node comparisons119
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements15
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)8.0
    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 MeterInterval))
    3
    if (!(obj instanceof MeterInterval))
    5
    if (!(obj instanceof WaterfallBarRenderer))
    Differences
    Expression1Expression2Difference
    org.jfree.chart.plot.MeterIntervalorg.jfree.chart.renderer.category.WaterfallBarRendererVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jfree.chart.plot.MeterInterval does not match with type org.jfree.chart.renderer.category.WaterfallBarRenderer
    • Make classes org.jfree.chart.plot.MeterInterval and org.jfree.chart.renderer.category.WaterfallBarRenderer extend a common superclass
    5
    if (!(obj instanceof WaterfallBarRenderer))
    4
    return false;
    6
    return false;
    5
    MeterInterval that = (MeterInterval)obj;
                                                                                      
    6
    if (!this.label.equals(that.label))
    6
    if (!this.label.equals(that.label))
    3
    if (!super.equals(obj))
    Differences
    Expression1Expression2Difference
    this.label.equals(that.label)super.equals(obj)TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression this.label.equals(that.label) 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))
    7
    return false;
    4
    return false;
                                                                                                                  
    7
    WaterfallBarRenderer that = (WaterfallBarRenderer)obj;
    8
    if (!this.range.equals(that.range))
    8
    if (!this.range.equals(that.range))
    8
    if (!PaintUtilities.equal(this.firstBarPaint, that.firstBarPaint))
    Differences
    Expression1Expression2Difference
    this.range.equals(that.range)PaintUtilities.equal(this.firstBarPaint,that.firstBarPaint)TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression this.range.equals(that.range) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression PaintUtilities.equal(this.firstBarPaint,that.firstBarPaint) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8
    if (!PaintUtilities.equal(this.firstBarPaint, that.firstBarPaint))
    9
    return false;
    9
    return false;
    10
    if (!PaintUtilities.equal(this.outlinePaint, that.outlinePaint))
    10
    if (!PaintUtilities.equal(this.outlinePaint, that.outlinePaint))
    10
    if (!PaintUtilities.equal(this.lastBarPaint, that.lastBarPaint))
    Differences
    Expression1Expression2Difference
    outlinePaintlastBarPaintVARIABLE_NAME_MISMATCH
    org.jfree.chart.plot.MeterIntervalorg.jfree.chart.renderer.category.WaterfallBarRendererVARIABLE_TYPE_MISMATCH
    outlinePaintlastBarPaintVARIABLE_NAME_MISMATCH
    Preondition Violations
    Type java.awt.Paint of variable that.outlinePaint does not match with type java.awt.Paint of variable that.lastBarPaint
    • Make classes org.jfree.chart.plot.MeterInterval and org.jfree.chart.renderer.category.WaterfallBarRenderer extend a common superclass
    Expression that.outlinePaint 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
    10
    if (!PaintUtilities.equal(this.lastBarPaint, that.lastBarPaint))
    11
    return false;
    11
    return false;
    12
    if (!ObjectUtilities.equal(this.outlineStroke, that.outlineStroke))
    12
    if (!ObjectUtilities.equal(this.outlineStroke, that.outlineStroke))
    12
    if (!PaintUtilities.equal(this.positiveBarPaint, that.positiveBarPaint))
    Differences
    Expression1Expression2Difference
    outlineStrokepositiveBarPaintVARIABLE_NAME_MISMATCH
    java.awt.Strokejava.awt.PaintVARIABLE_TYPE_MISMATCH
    org.jfree.chart.plot.MeterIntervalorg.jfree.chart.renderer.category.WaterfallBarRendererVARIABLE_TYPE_MISMATCH
    outlineStrokepositiveBarPaintVARIABLE_NAME_MISMATCH
    java.awt.Strokejava.awt.PaintVARIABLE_TYPE_MISMATCH
    org.jfree.util.ObjectUtilitiesorg.jfree.util.PaintUtilitiesVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.awt.Stroke of variable this.outlineStroke does not match with type java.awt.Paint of variable this.positiveBarPaint
    • Make classes java.awt.Stroke and java.awt.Paint extend a common superclass
    Type java.awt.Stroke of variable that.outlineStroke does not match with type java.awt.Paint of variable that.positiveBarPaint
    • Make classes org.jfree.chart.plot.MeterInterval and org.jfree.chart.renderer.category.WaterfallBarRenderer extend a common superclass
    Expression that.outlineStroke 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
    Type java.awt.Stroke of variable that.outlineStroke does not match with type java.awt.Paint of variable that.positiveBarPaint
    • Make classes java.awt.Stroke 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
    12
    if (!PaintUtilities.equal(this.positiveBarPaint, that.positiveBarPaint))
    13
    return false;
    13
    return false;
    14
    if (!PaintUtilities.equal(this.backgroundPaint, that.backgroundPaint))
    14
    if (!PaintUtilities.equal(this.backgroundPaint, that.backgroundPaint))
    14
    if (!PaintUtilities.equal(this.negativeBarPaint, that.negativeBarPaint))
    Differences
    Expression1Expression2Difference
    backgroundPaintnegativeBarPaintVARIABLE_NAME_MISMATCH
    org.jfree.chart.plot.MeterIntervalorg.jfree.chart.renderer.category.WaterfallBarRendererVARIABLE_TYPE_MISMATCH
    backgroundPaintnegativeBarPaintVARIABLE_NAME_MISMATCH
    Preondition Violations
    Type java.awt.Paint of variable that.backgroundPaint does not match with type java.awt.Paint of variable that.negativeBarPaint
    • Make classes org.jfree.chart.plot.MeterInterval and org.jfree.chart.renderer.category.WaterfallBarRenderer extend a common superclass
    Expression that.backgroundPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.negativeBarPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    14
    if (!PaintUtilities.equal(this.negativeBarPaint, that.negativeBarPaint))
    15
    return false;
    15
    return false;
    16
    return true;
    16
    return true;
    Precondition Violations (18)
    Row Violation
    1Type org.jfree.chart.plot.MeterInterval does not match with type org.jfree.chart.renderer.category.WaterfallBarRenderer
    2Expression this.label.equals(that.label) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Super method call if(!super.equals(obj)) cannot be extracted from method
    4Expression this.range.equals(that.range) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression PaintUtilities.equal(this.firstBarPaint,that.firstBarPaint) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Type java.awt.Paint of variable that.outlinePaint does not match with type java.awt.Paint of variable that.lastBarPaint
    7Expression that.outlinePaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Expression that.lastBarPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    9Type java.awt.Stroke of variable this.outlineStroke does not match with type java.awt.Paint of variable this.positiveBarPaint
    10Type java.awt.Stroke of variable that.outlineStroke does not match with type java.awt.Paint of variable that.positiveBarPaint
    11Expression that.outlineStroke cannot be parameterized, because it has dependencies to/from statements that will be extracted
    12Expression that.positiveBarPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    13Type java.awt.Stroke of variable that.outlineStroke does not match with type java.awt.Paint of variable that.positiveBarPaint
    14Type org.jfree.util.ObjectUtilities does not match with type org.jfree.util.PaintUtilities
    15Type java.awt.Paint of variable that.backgroundPaint does not match with type java.awt.Paint of variable that.negativeBarPaint
    16Expression that.backgroundPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    17Expression that.negativeBarPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    18The refactoring of the clones is infeasible, because classes org.jfree.chart.plot.MeterInterval and org.jfree.chart.renderer.category.WaterfallBarRenderer do not have a common superclass