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 DialTextAnnotation)) { return false; } DialTextAnnotation that = (DialTextAnnotation) obj; if (!this.label.equals(that.label)) { return false; } if (!this.font.equals(that.font)) { return false; } if (!PaintUtilities.equal(this.paint, that.paint)) { return false; } if (this.radius != that.radius) { return false; } if (this.angle != that.angle) { return false; } if (!this.anchor.equals(that.anchor)) { return false; } return super.equals(obj);
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/plot/dial/DialTextAnnotation.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 DialTextAnnotation)) {
5
            return false;
5
            return false;
6
        }
6
        }
7
        if (!super.equals(obj)) {
7
        
8
            return false;
9
        }
10
        NumberAxis that = (NumberAxis) obj;
8
DialTextAnnotation that = (DialTextAnnotation) obj;
11
        if (this.autoRangeIncludesZero != that.autoRangeIncludesZero) {
9
        if (!this.label.equals(that.label)) {
12
            return false;
10
            return false;
13
        }
11
        }
14
        if (this.autoRangeStickyZero != that.autoRangeStickyZero) {
12
        if (!this.font.equals(that.font)) {
15
            return false;
13
            return false;
16
        }
14
        }
17
        if (!ObjectUtilities.equal(this.tickUnit, that.tickUnit)) {
15
        if (!PaintUtilities.equal(this.paint, that.paint)) {
18
            return false;
16
            return false;
19
        }
17
        }
20
        if (!ObjectUtilities.equal(this.numberFormatOverride,
18
        if (this.radius != that.radius) {
19
            return false;
21
        
20
        }
22
        that.numberFormatOverride)) {
21
        if (this.angle != that.angle) {
23
            return false;
22
            return false;
24
        }
23
        }
25
        if (!this.rangeType.equals(that.rangeType)) {
24
        if (!this.anchor.equals(that.anchor)) {
26
            return false;
25
            return false;
27
        }
26
        }
28
        return true;
27
        return super.equals(obj);
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.8
Clones locationClones are in different classes
Number of node comparisons125
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements17
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)6.8
    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 DialTextAnnotation))
    Differences
    Expression1Expression2Difference
    org.jfree.chart.axis.NumberAxisorg.jfree.chart.plot.dial.DialTextAnnotationSUBCLASS_TYPE_MISMATCH
    3
    if (!(obj instanceof DialTextAnnotation))
    4
    return false;
    4
    return false;
                                                                                                          
    5
    DialTextAnnotation that = (DialTextAnnotation)obj;
    5
    if (!super.equals(obj))
    5
    if (!super.equals(obj))
    6
    if (!this.label.equals(that.label))
    Differences
    Expression1Expression2Difference
    super.equals(obj)this.label.equals(that.label)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
    6
    if (!this.label.equals(that.label))
    6
    return false;
    7
    return false;
    7
    NumberAxis that = (NumberAxis)obj;
                                                                          
    8
    if (this.autoRangeIncludesZero != that.autoRangeIncludesZero)
    8
    if (this.autoRangeIncludesZero != that.autoRangeIncludesZero)
    12
    if (this.radius != that.radius)
    Differences
    Expression1Expression2Difference
    autoRangeIncludesZeroradiusVARIABLE_NAME_MISMATCH
    booleandoubleVARIABLE_TYPE_MISMATCH
    org.jfree.chart.axis.NumberAxisorg.jfree.chart.plot.dial.DialTextAnnotationSUBCLASS_TYPE_MISMATCH
    autoRangeIncludesZeroradiusVARIABLE_NAME_MISMATCH
    booleandoubleVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type boolean of variable this.autoRangeIncludesZero does not match with type double of variable this.radius
    Expression that.autoRangeIncludesZero cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.radius cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type boolean of variable that.autoRangeIncludesZero does not match with type double of variable that.radius
    12
    if (this.radius != that.radius)
    9
    return false;
    13
    return false;
    10
    if (this.autoRangeStickyZero != that.autoRangeStickyZero)
    10
    if (this.autoRangeStickyZero != that.autoRangeStickyZero)
    14
    if (this.angle != that.angle)
    Differences
    Expression1Expression2Difference
    autoRangeStickyZeroangleVARIABLE_NAME_MISMATCH
    booleandoubleVARIABLE_TYPE_MISMATCH
    org.jfree.chart.axis.NumberAxisorg.jfree.chart.plot.dial.DialTextAnnotationSUBCLASS_TYPE_MISMATCH
    autoRangeStickyZeroangleVARIABLE_NAME_MISMATCH
    booleandoubleVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type boolean of variable this.autoRangeStickyZero does not match with type double of variable this.angle
    Expression that.autoRangeStickyZero cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.angle cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type boolean of variable that.autoRangeStickyZero does not match with type double of variable that.angle
    14
    if (this.angle != that.angle)
    11
    return false;
    15
    return false;
    12
    if (!ObjectUtilities.equal(this.tickUnit, that.tickUnit))
    12
    if (!ObjectUtilities.equal(this.tickUnit, that.tickUnit))
    10
    if (!PaintUtilities.equal(this.paint, that.paint))
    Differences
    Expression1Expression2Difference
    tickUnitpaintVARIABLE_NAME_MISMATCH
    org.jfree.chart.axis.NumberTickUnitjava.awt.PaintVARIABLE_TYPE_MISMATCH
    org.jfree.chart.axis.NumberAxisorg.jfree.chart.plot.dial.DialTextAnnotationSUBCLASS_TYPE_MISMATCH
    tickUnitpaintVARIABLE_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.paint
    • 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.paint 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.paint
    • 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.paint, that.paint))
    13
    return false;
    11
    return false;
    14
    if (!ObjectUtilities.equal(this.numberFormatOverride, that.numberFormatOverride))
    14
    if (!ObjectUtilities.equal(this.numberFormatOverride, that.numberFormatOverride))
    16
    if (!this.anchor.equals(that.anchor))
    Differences
    Expression1Expression2Difference
    ObjectUtilities.equal(this.numberFormatOverride,that.numberFormatOverride)this.anchor.equals(that.anchor)TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression ObjectUtilities.equal(this.numberFormatOverride,that.numberFormatOverride) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression this.anchor.equals(that.anchor) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    16
    if (!this.anchor.equals(that.anchor))
    15
    return false;
    17
    return false;
    16
    if (!this.rangeType.equals(that.rangeType))
    16
    if (!this.rangeType.equals(that.rangeType))
    8
    if (!this.font.equals(that.font))
    Differences
    Expression1Expression2Difference
    org.jfree.chart.axis.NumberAxisorg.jfree.chart.plot.dial.DialTextAnnotationSUBCLASS_TYPE_MISMATCH
    rangeTypefontVARIABLE_NAME_MISMATCH
    org.jfree.data.RangeTypejava.awt.FontVARIABLE_TYPE_MISMATCH
    rangeTypefontVARIABLE_NAME_MISMATCH
    org.jfree.data.RangeTypejava.awt.FontVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Expression that.rangeType cannot be unified with expression that.font , because common superclass type java.io.Serializable cannot be passed as an argument to public boolean equals(java.lang.Object)
    Expression that.rangeType cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.font cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type org.jfree.data.RangeType of variable that.rangeType does not match with type java.awt.Font of variable that.font
    • Make classes org.jfree.data.RangeType and java.awt.Font extend a common superclass
    Type org.jfree.data.RangeType of variable this.rangeType does not match with type java.awt.Font of variable this.font
    • Make classes org.jfree.data.RangeType and java.awt.Font extend a common superclass
    8
    if (!this.font.equals(that.font))
    17
    return false;
    9
    return false;
    18
    return true;
    18
    return true;
    18
    return super.equals(obj);
    Differences
    Expression1Expression2Difference
    truesuper.equals(obj)TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Super method call return super.equals(obj); cannot be extracted from method
    18
    return super.equals(obj);
    Precondition Violations (24)
    Row Violation
    1Expression this.label.equals(that.label) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Super method call if(!super.equals(obj)) cannot be extracted from method
    3Type boolean of variable this.autoRangeIncludesZero does not match with type double of variable this.radius
    4Expression that.autoRangeIncludesZero cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression that.radius cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Type boolean of variable that.autoRangeIncludesZero does not match with type double of variable that.radius
    7Type boolean of variable this.autoRangeStickyZero does not match with type double of variable this.angle
    8Expression that.autoRangeStickyZero cannot be parameterized, because it has dependencies to/from statements that will be extracted
    9Expression that.angle cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10Type boolean of variable that.autoRangeStickyZero does not match with type double of variable that.angle
    11Type org.jfree.chart.axis.NumberTickUnit of variable this.tickUnit does not match with type java.awt.Paint of variable this.paint
    12Expression that.tickUnit cannot be parameterized, because it has dependencies to/from statements that will be extracted
    13Expression that.paint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    14Type org.jfree.chart.axis.NumberTickUnit of variable that.tickUnit does not match with type java.awt.Paint of variable that.paint
    15Type org.jfree.util.ObjectUtilities does not match with type org.jfree.util.PaintUtilities
    16Expression ObjectUtilities.equal(this.numberFormatOverride,that.numberFormatOverride) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    17Expression this.anchor.equals(that.anchor) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    18Expression that.rangeType cannot be unified with expression that.font , because common superclass type java.io.Serializable cannot be passed as an argument to public boolean equals(java.lang.Object)
    19Expression that.rangeType cannot be parameterized, because it has dependencies to/from statements that will be extracted
    20Expression that.font cannot be parameterized, because it has dependencies to/from statements that will be extracted
    21Type org.jfree.data.RangeType of variable that.rangeType does not match with type java.awt.Font of variable that.font
    22Type org.jfree.data.RangeType of variable this.rangeType does not match with type java.awt.Font of variable this.font
    23Super method call return super.equals(obj); cannot be extracted from method
    24The refactoring of the clones is infeasible, because classes org.jfree.chart.axis.NumberAxis and org.jfree.chart.plot.dial.DialTextAnnotation do not have a common superclass