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 (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/axis/NumberAxis.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 NumberAxis)) {
4
        if (!(obj instanceof HighLowRenderer)) {
5
            return false;
5
            return false;
6
        }
6
        }
7
        if (!super.equals(obj)) {
7
        
8
            return false;
9
        }
10
        NumberAxis that = (NumberAxis) obj;
8
HighLowRenderer that = (HighLowRenderer) obj;
11
        if (this.autoRangeIncludesZero != that.autoRangeIncludesZero) {
9
        if (this.drawOpenTicks != that.drawOpenTicks) {
12
            return false;
10
            return false;
13
        }
11
        }
14
        if (this.autoRangeStickyZero != that.autoRangeStickyZero) {
12
        if (this.drawCloseTicks != that.drawCloseTicks) {
15
            return false;
13
            return false;
16
        }
14
        }
17
        if (!ObjectUtilities.equal(this.tickUnit, that.tickUnit)) {
15
        if (!PaintUtilities.equal(this.openTickPaint, that.openTickPaint)) {
18
            return false;
16
            return false;
19
        }
17
        }
20
        if (!ObjectUtilities.equal(this.numberFormatOverride,
18
        if (!PaintUtilities.equal(this.closeTickPaint, that.closeTickPaint)) {
19
            return false;
21
        
20
        }
22
        that.numberFormatOverride)) {
21
        if (this.tickLength != that.tickLength) {
23
            return false;
22
            return false;
24
        }
23
        }
25
        if (!this.rangeType.equals(that.rangeType)) {
24
        if (!super.equals(obj)) {
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.5
Clones locationClones are in different classes
Number of node comparisons110
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements12
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment3
    Time elapsed for statement mapping (ms)5.6
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    3
    if (!(obj instanceof NumberAxis))
    3
    if (!(obj instanceof NumberAxis))
    3
    if (!(obj instanceof HighLowRenderer))
    Differences
    Expression1Expression2Difference
    org.jfree.chart.axis.NumberAxisorg.jfree.chart.renderer.xy.HighLowRendererSUBCLASS_TYPE_MISMATCH
    3
    if (!(obj instanceof HighLowRenderer))
    4
    return false;
    4
    return false;
                                                                                              
    5
    HighLowRenderer that = (HighLowRenderer)obj;
                                                                                        
    14
    if (this.tickLength != that.tickLength)
                                      
    15
    return false;
    Preondition Violations
    Unmatched return false;
    15
    return false;
    5
    if (!super.equals(obj))
    5
    if (!super.equals(obj))
    16
    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
    16
    if (!super.equals(obj))
    6
    return false;
    17
    return false;
    7
    NumberAxis that = (NumberAxis)obj;
                                                                          
    8
    if (this.autoRangeIncludesZero != that.autoRangeIncludesZero)
    8
    if (this.autoRangeIncludesZero != that.autoRangeIncludesZero)
    8
    if (this.drawCloseTicks != that.drawCloseTicks)
    Differences
    Expression1Expression2Difference
    autoRangeIncludesZerodrawCloseTicksVARIABLE_NAME_MISMATCH
    org.jfree.chart.axis.NumberAxisorg.jfree.chart.renderer.xy.HighLowRendererSUBCLASS_TYPE_MISMATCH
    autoRangeIncludesZerodrawCloseTicksVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression that.autoRangeIncludesZero cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.drawCloseTicks cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8
    if (this.drawCloseTicks != that.drawCloseTicks)
    9
    return false;
    9
    return false;
    10
    if (this.autoRangeStickyZero != that.autoRangeStickyZero)
    10
    if (this.autoRangeStickyZero != that.autoRangeStickyZero)
    6
    if (this.drawOpenTicks != that.drawOpenTicks)
    Differences
    Expression1Expression2Difference
    autoRangeStickyZerodrawOpenTicksVARIABLE_NAME_MISMATCH
    org.jfree.chart.axis.NumberAxisorg.jfree.chart.renderer.xy.HighLowRendererSUBCLASS_TYPE_MISMATCH
    autoRangeStickyZerodrawOpenTicksVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression that.autoRangeStickyZero 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
    6
    if (this.drawOpenTicks != that.drawOpenTicks)
    11
    return false;
    7
    return false;
    12
    if (!ObjectUtilities.equal(this.tickUnit, that.tickUnit))
    12
    if (!ObjectUtilities.equal(this.tickUnit, that.tickUnit))
    12
    if (!PaintUtilities.equal(this.closeTickPaint, that.closeTickPaint))
    Differences
    Expression1Expression2Difference
    tickUnitcloseTickPaintVARIABLE_NAME_MISMATCH
    org.jfree.chart.axis.NumberTickUnitjava.awt.PaintVARIABLE_TYPE_MISMATCH
    org.jfree.chart.axis.NumberAxisorg.jfree.chart.renderer.xy.HighLowRendererSUBCLASS_TYPE_MISMATCH
    tickUnitcloseTickPaintVARIABLE_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.closeTickPaint
    • 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.closeTickPaint 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.closeTickPaint
    • 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.closeTickPaint, that.closeTickPaint))
    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.openTickPaint, that.openTickPaint))
    Differences
    Expression1Expression2Difference
    numberFormatOverrideopenTickPaintVARIABLE_NAME_MISMATCH
    java.text.NumberFormatjava.awt.PaintVARIABLE_TYPE_MISMATCH
    org.jfree.chart.axis.NumberAxisorg.jfree.chart.renderer.xy.HighLowRendererSUBCLASS_TYPE_MISMATCH
    numberFormatOverrideopenTickPaintVARIABLE_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.openTickPaint
    • 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.openTickPaint 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.openTickPaint
    • 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.openTickPaint, that.openTickPaint))
    15
    return false;
    11
    return false;
    Precondition Violations (18)
    Row Violation
    1Unmatched return false;
    2Super method call if(!super.equals(obj)) cannot be extracted from method
    3Super method call if(!super.equals(obj)) cannot be extracted from method
    4Expression that.autoRangeIncludesZero cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression that.drawCloseTicks cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression that.autoRangeStickyZero cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression that.drawOpenTicks cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Type org.jfree.chart.axis.NumberTickUnit of variable this.tickUnit does not match with type java.awt.Paint of variable this.closeTickPaint
    9Expression that.tickUnit cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10Expression that.closeTickPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    11Type org.jfree.chart.axis.NumberTickUnit of variable that.tickUnit does not match with type java.awt.Paint of variable that.closeTickPaint
    12Type org.jfree.util.ObjectUtilities does not match with type org.jfree.util.PaintUtilities
    13Type java.text.NumberFormat of variable this.numberFormatOverride does not match with type java.awt.Paint of variable this.openTickPaint
    14Expression that.numberFormatOverride 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 java.text.NumberFormat of variable that.numberFormatOverride 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
    18Not all possible execution flows end in a return statement