if (obj == this) { return true; } if (!(obj instanceof NumberAxis)) { return false; } if (!super.equals(obj)) { return false; } NumberAxis that = (NumberAxis) obj; if (this.autoRangeIncludesZero != that.autoRangeIncludesZero) { return false; } if (this.autoRangeStickyZero != that.autoRangeStickyZero) { return false; } if (!ObjectUtilities.equal(this.tickUnit, that.tickUnit)) { return false; } if (!ObjectUtilities.equal(this.numberFormatOverride, that.numberFormatOverride)) { return false; } if (!this.rangeType.equals(that.rangeType)) { 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/axis/NumberAxis.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 NumberAxis)) {
4
        if (!super.equals(obj)) {
5
            return false;
5
            return false;
6
        }
6
        }
7
        if (!super.equals(obj)) {
7
        if (!(obj instanceof WaterfallBarRenderer)) {
8
            return false;
8
            return false;
9
        }
9
        }
10
        NumberAxis that = (NumberAxis) obj;
10
        
11
        if (this.autoRangeIncludesZero != that.autoRangeIncludesZero) {
11
WaterfallBarRenderer that = (WaterfallBarRenderer) obj;
12
            return false;
12
        
13
        }
14
        if (this.autoRangeStickyZero != that.autoRangeStickyZero) {
13
if (!PaintUtilities.equal(this.firstBarPaint, that.firstBarPaint)) {
15
            return false;
14
            return false;
16
        }
15
        }
17
        if (!ObjectUtilities.equal(this.tickUnit, that.tickUnit)) {
16
        if (!PaintUtilities.equal(this.lastBarPaint, that.lastBarPaint)) {
18
            return false;
17
            return false;
19
        }
18
        }
20
        if (!ObjectUtilities.equal(this.numberFormatOverride,
19
        if (!PaintUtilities.equal(this.positiveBarPaint,
21
                that.numberFormatOverride)) {
20
                that.positiveBarPaint)) {
22
            return false;
21
            return false;
23
        }
22
        }
24
        if (!this.rangeType.equals(that.rangeType
23
        if (!PaintUtilities.equal(this.negativeBarPaint,
25
)) {
24
                that.negativeBarPaint)) {
26
            return false;
25
            return false;
27
        }
26
        }
28
        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)5.2
Clones locationClones are in different classes
Number of node comparisons105
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements13
    Number of unmapped statements in the first code fragment4
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)7.6
    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 NumberAxis))
    3
    if (!(obj instanceof NumberAxis))
    5
    if (!(obj instanceof WaterfallBarRenderer))
    Differences
    Expression1Expression2Difference
    org.jfree.chart.axis.NumberAxisorg.jfree.chart.renderer.category.WaterfallBarRendererSUBCLASS_TYPE_MISMATCH
    5
    if (!(obj instanceof WaterfallBarRenderer))
    4
    return false;
    6
    return false;
    5
    if (!super.equals(obj))
    5
    if (!super.equals(obj))
    3
    if (!super.equals(obj))
    Preondition Violations
    Super method call if(!super.equals(obj)) cannot be extracted from method
    Super method call if(!super.equals(obj)) cannot be extracted from method
    3
    if (!super.equals(obj))
    6
    return false;
    4
    return false;
    7
    NumberAxis that = (NumberAxis)obj;
    7
    NumberAxis that = (NumberAxis)obj;
    7
    WaterfallBarRenderer that = (WaterfallBarRenderer)obj;
    Differences
    Expression1Expression2Difference
    org.jfree.chart.axis.NumberAxisorg.jfree.chart.renderer.category.WaterfallBarRendererSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.axis.NumberAxisorg.jfree.chart.renderer.category.WaterfallBarRendererSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.axis.NumberAxisorg.jfree.chart.renderer.category.WaterfallBarRendererSUBCLASS_TYPE_MISMATCH
    7
    WaterfallBarRenderer that = (WaterfallBarRenderer)obj;
    8
    if (this.autoRangeIncludesZero != that.autoRangeIncludesZero)
    8
    if (this.autoRangeIncludesZero != that.autoRangeIncludesZero)
    Preondition Violations
    Unmatched statement if(this.autoRangeIncludesZero != that.autoRangeIncludesZero) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                                                                  
    9
    return false;
    9
    return false;
    Preondition Violations
    Unmatched return false;
                                    
    10
    if (this.autoRangeStickyZero != that.autoRangeStickyZero)
    10
    if (this.autoRangeStickyZero != that.autoRangeStickyZero)
    Preondition Violations
    Unmatched statement if(this.autoRangeStickyZero != that.autoRangeStickyZero) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                                                            
    11
    return false;
    11
    return false;
    Preondition Violations
    Unmatched return false;
                                      
    12
    if (!ObjectUtilities.equal(this.tickUnit, that.tickUnit))
    12
    if (!ObjectUtilities.equal(this.tickUnit, that.tickUnit))
    12
    if (!PaintUtilities.equal(this.positiveBarPaint, that.positiveBarPaint))
    Differences
    Expression1Expression2Difference
    tickUnitpositiveBarPaintVARIABLE_NAME_MISMATCH
    org.jfree.chart.axis.NumberTickUnitjava.awt.PaintVARIABLE_TYPE_MISMATCH
    org.jfree.chart.axis.NumberAxisorg.jfree.chart.renderer.category.WaterfallBarRendererSUBCLASS_TYPE_MISMATCH
    tickUnitpositiveBarPaintVARIABLE_NAME_MISMATCH
    org.jfree.chart.axis.NumberTickUnitjava.awt.PaintVARIABLE_TYPE_MISMATCH
    org.jfree.util.ObjectUtilitiesorg.jfree.util.PaintUtilitiesVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jfree.chart.axis.NumberTickUnit of variable this.tickUnit does not match with type java.awt.Paint of variable this.positiveBarPaint
    • Make classes org.jfree.chart.axis.NumberTickUnit and java.awt.Paint extend a common superclass
    Expression that.tickUnit 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 org.jfree.chart.axis.NumberTickUnit of variable that.tickUnit does not match with type java.awt.Paint of variable that.positiveBarPaint
    • Make classes org.jfree.chart.axis.NumberTickUnit 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 (!ObjectUtilities.equal(this.numberFormatOverride, that.numberFormatOverride))
    14
    if (!ObjectUtilities.equal(this.numberFormatOverride, that.numberFormatOverride))
    10
    if (!PaintUtilities.equal(this.lastBarPaint, that.lastBarPaint))
    Differences
    Expression1Expression2Difference
    numberFormatOverridelastBarPaintVARIABLE_NAME_MISMATCH
    java.text.NumberFormatjava.awt.PaintVARIABLE_TYPE_MISMATCH
    org.jfree.chart.axis.NumberAxisorg.jfree.chart.renderer.category.WaterfallBarRendererSUBCLASS_TYPE_MISMATCH
    numberFormatOverridelastBarPaintVARIABLE_NAME_MISMATCH
    java.text.NumberFormatjava.awt.PaintVARIABLE_TYPE_MISMATCH
    org.jfree.util.ObjectUtilitiesorg.jfree.util.PaintUtilitiesVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.text.NumberFormat of variable this.numberFormatOverride does not match with type java.awt.Paint of variable this.lastBarPaint
    • Make classes java.text.NumberFormat and java.awt.Paint extend a common superclass
    Expression that.numberFormatOverride 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 java.text.NumberFormat of variable that.numberFormatOverride does not match with type java.awt.Paint of variable that.lastBarPaint
    • Make classes java.text.NumberFormat 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 (!this.rangeType.equals(that.rangeType))
    16
    if (!this.rangeType.equals(that.rangeType))
    8
    if (!PaintUtilities.equal(this.firstBarPaint, that.firstBarPaint))
    Differences
    Expression1Expression2Difference
    this.rangeType.equals(that.rangeType)PaintUtilities.equal(this.firstBarPaint,that.firstBarPaint)TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression this.rangeType.equals(that.rangeType) 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))
    17
    return false;
    9
    return false;
    Precondition Violations (21)
    Row Violation
    1Super method call if(!super.equals(obj)) cannot be extracted from method
    2Super method call if(!super.equals(obj)) cannot be extracted from method
    3Unmatched statement if(this.autoRangeIncludesZero != that.autoRangeIncludesZero) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    4Unmatched return false;
    5Unmatched statement if(this.autoRangeStickyZero != that.autoRangeStickyZero) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    6Unmatched return false;
    7Type org.jfree.chart.axis.NumberTickUnit of variable this.tickUnit does not match with type java.awt.Paint of variable this.positiveBarPaint
    8Expression that.tickUnit cannot be parameterized, because it has dependencies to/from statements that will be extracted
    9Expression that.positiveBarPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10Type org.jfree.chart.axis.NumberTickUnit of variable that.tickUnit does not match with type java.awt.Paint of variable that.positiveBarPaint
    11Type org.jfree.util.ObjectUtilities does not match with type org.jfree.util.PaintUtilities
    12Type java.text.NumberFormat of variable this.numberFormatOverride does not match with type java.awt.Paint of variable this.lastBarPaint
    13Expression that.numberFormatOverride cannot be parameterized, because it has dependencies to/from statements that will be extracted
    14Expression that.lastBarPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    15Type java.text.NumberFormat of variable that.numberFormatOverride does not match with type java.awt.Paint of variable that.lastBarPaint
    16Type org.jfree.util.ObjectUtilities does not match with type org.jfree.util.PaintUtilities
    17Expression this.rangeType.equals(that.rangeType) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    18Expression PaintUtilities.equal(this.firstBarPaint,that.firstBarPaint) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    19Clone fragment #1 returns variable that with type org.jfree.chart.axis.NumberAxis , while Clone fragment #2 returns variable that with type org.jfree.chart.renderer.category.WaterfallBarRenderer
    20Not all possible execution flows end in a return statement
    21The refactoring of the clones is infeasible, because classes org.jfree.chart.axis.NumberAxis and org.jfree.chart.renderer.category.WaterfallBarRenderer do not have a common superclass