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 (!(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/axis/NumberAxis.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 NumberAxis)) {
4
        if (!(obj instanceof XYDifferenceRenderer)) {
5
            return false;
5
            return false;   
6
        }
6
        }
7
        if (!super.equals(obj)) {
7
        if (!super.equals(obj)) {
8
            return false;
8
            return false;   
9
        }
9
        }
10
        NumberAxis that = (NumberAxis) obj;
10
        
11
        if (this.autoRangeIncludesZero != that.autoRangeIncludesZero
11
XYDifferenceRenderer that = (XYDifferenceRenderer) obj;
12
) {
12
        if (!PaintUtilities.equal(this.positivePaint, that.positivePaint)) {
13
            return false;
13
            return false;   
14
        }
14
        }
15
        if (this.autoRangeStickyZero != that.autoRangeStickyZero) {
15
        if (!PaintUtilities.equal(this.negativePaint, that.negativePaint)) {
16
            return false;
16
            return false;   
17
        }
17
        }
18
        if (!ObjectUtilities.equal(this.tickUnit, that.tickUnit)) {
18
        if (this.shapesVisible != that.shapesVisible) {
19
            return false;
19
            return false;   
20
        }
20
        }
21
        if (!ObjectUtilities.equal(this.numberFormatOverride,
21
        if (!ShapeUtilities.equal(this.
22
                that.numberFormatOverride)) {
22
legendLine, that.legendLine)) {
23
            return false;
23
            return false;   
24
        }
24
        }
25
        if (!this.rangeType.equals(that.rangeType)) {
25
        if (this.roundXCoordinates != that.roundXCoordinates) {
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.5
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)9.2
    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 NumberAxis))
    3
    if (!(obj instanceof NumberAxis))
    3
    if (!(obj instanceof XYDifferenceRenderer))
    Differences
    Expression1Expression2Difference
    org.jfree.chart.axis.NumberAxisorg.jfree.chart.renderer.xy.XYDifferenceRendererSUBCLASS_TYPE_MISMATCH
    3
    if (!(obj instanceof XYDifferenceRenderer))
    4
    return false;
    4
    return false;
    5
    if (!super.equals(obj))
    5
    if (!super.equals(obj))
    5
    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
    5
    if (!super.equals(obj))
    6
    return false;
    6
    return false;
    7
    NumberAxis that = (NumberAxis)obj;
    7
    NumberAxis that = (NumberAxis)obj;
    7
    XYDifferenceRenderer that = (XYDifferenceRenderer)obj;
    Differences
    Expression1Expression2Difference
    org.jfree.chart.axis.NumberAxisorg.jfree.chart.renderer.xy.XYDifferenceRendererSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.axis.NumberAxisorg.jfree.chart.renderer.xy.XYDifferenceRendererSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.axis.NumberAxisorg.jfree.chart.renderer.xy.XYDifferenceRendererSUBCLASS_TYPE_MISMATCH
    7
    XYDifferenceRenderer that = (XYDifferenceRenderer)obj;
    8
    if (this.autoRangeIncludesZero != that.autoRangeIncludesZero)
    8
    if (this.autoRangeIncludesZero != that.autoRangeIncludesZero)
    12
    if (this.shapesVisible != that.shapesVisible)
    Differences
    Expression1Expression2Difference
    autoRangeIncludesZeroshapesVisibleVARIABLE_NAME_MISMATCH
    org.jfree.chart.axis.NumberAxisorg.jfree.chart.renderer.xy.XYDifferenceRendererSUBCLASS_TYPE_MISMATCH
    autoRangeIncludesZeroshapesVisibleVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression that.autoRangeIncludesZero 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
    12
    if (this.shapesVisible != that.shapesVisible)
    9
    return false;
    13
    return false;
    10
    if (this.autoRangeStickyZero != that.autoRangeStickyZero)
    10
    if (this.autoRangeStickyZero != that.autoRangeStickyZero)
    16
    if (this.roundXCoordinates != that.roundXCoordinates)
    Differences
    Expression1Expression2Difference
    autoRangeStickyZeroroundXCoordinatesVARIABLE_NAME_MISMATCH
    org.jfree.chart.axis.NumberAxisorg.jfree.chart.renderer.xy.XYDifferenceRendererSUBCLASS_TYPE_MISMATCH
    autoRangeStickyZeroroundXCoordinatesVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression that.autoRangeStickyZero 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
    16
    if (this.roundXCoordinates != that.roundXCoordinates)
    11
    return false;
    17
    return false;
    12
    if (!ObjectUtilities.equal(this.tickUnit, that.tickUnit))
    12
    if (!ObjectUtilities.equal(this.tickUnit, that.tickUnit))
    10
    if (!PaintUtilities.equal(this.negativePaint, that.negativePaint))
    Differences
    Expression1Expression2Difference
    tickUnitnegativePaintVARIABLE_NAME_MISMATCH
    org.jfree.chart.axis.NumberTickUnitjava.awt.PaintVARIABLE_TYPE_MISMATCH
    org.jfree.chart.axis.NumberAxisorg.jfree.chart.renderer.xy.XYDifferenceRendererSUBCLASS_TYPE_MISMATCH
    tickUnitnegativePaintVARIABLE_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.negativePaint
    • 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.negativePaint 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.negativePaint
    • 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
    10
    if (!PaintUtilities.equal(this.negativePaint, that.negativePaint))
    13
    return false;
    11
    return false;
    14
    if (!ObjectUtilities.equal(this.numberFormatOverride, that.numberFormatOverride))
    14
    if (!ObjectUtilities.equal(this.numberFormatOverride, that.numberFormatOverride))
    14
    if (!ShapeUtilities.equal(this.legendLine, that.legendLine))
    Differences
    Expression1Expression2Difference
    numberFormatOverridelegendLineVARIABLE_NAME_MISMATCH
    java.text.NumberFormatjava.awt.ShapeVARIABLE_TYPE_MISMATCH
    org.jfree.chart.axis.NumberAxisorg.jfree.chart.renderer.xy.XYDifferenceRendererSUBCLASS_TYPE_MISMATCH
    numberFormatOverridelegendLineVARIABLE_NAME_MISMATCH
    java.text.NumberFormatjava.awt.ShapeVARIABLE_TYPE_MISMATCH
    org.jfree.util.ObjectUtilitiesorg.jfree.util.ShapeUtilitiesVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.text.NumberFormat of variable this.numberFormatOverride does not match with type java.awt.Shape of variable this.legendLine
    • Make classes java.text.NumberFormat and java.awt.Shape extend a common superclass
    Expression that.numberFormatOverride 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 java.text.NumberFormat of variable that.numberFormatOverride does not match with type java.awt.Shape of variable that.legendLine
    • Make classes java.text.NumberFormat 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 (!this.rangeType.equals(that.rangeType))
    16
    if (!this.rangeType.equals(that.rangeType))
    8
    if (!PaintUtilities.equal(this.positivePaint, that.positivePaint))
    Differences
    Expression1Expression2Difference
    this.rangeType.equals(that.rangeType)PaintUtilities.equal(this.positivePaint,that.positivePaint)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.positivePaint,that.positivePaint) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8
    if (!PaintUtilities.equal(this.positivePaint, that.positivePaint))
    17
    return false;
    9
    return false;
    18
    return true;
    18
    return true;
    Precondition Violations (19)
    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
    3Expression that.autoRangeIncludesZero cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression that.shapesVisible cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression that.autoRangeStickyZero cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression that.roundXCoordinates cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Type org.jfree.chart.axis.NumberTickUnit of variable this.tickUnit does not match with type java.awt.Paint of variable this.negativePaint
    8Expression that.tickUnit cannot be parameterized, because it has dependencies to/from statements that will be extracted
    9Expression that.negativePaint 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.negativePaint
    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.Shape of variable this.legendLine
    13Expression that.numberFormatOverride cannot be parameterized, because it has dependencies to/from statements that will be extracted
    14Expression that.legendLine 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.Shape of variable that.legendLine
    16Type org.jfree.util.ObjectUtilities does not match with type org.jfree.util.ShapeUtilities
    17Expression this.rangeType.equals(that.rangeType) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    18Expression PaintUtilities.equal(this.positivePaint,that.positivePaint) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    19The refactoring of the clones is infeasible, because classes org.jfree.chart.axis.NumberAxis and org.jfree.chart.renderer.xy.XYDifferenceRenderer do not have a common superclass