if (obj == this) { return true; } if (!(obj instanceof MarkerAxisBand)) { return false; } MarkerAxisBand that = (MarkerAxisBand) obj; if (this.topOuterGap != that.topOuterGap) { return false; } if (this.topInnerGap != that.topInnerGap) { return false; } if (this.bottomInnerGap != that.bottomInnerGap) { return false; } if (this.bottomOuterGap != that.bottomOuterGap) { return false; } if (!ObjectUtilities.equal(this.font, that.font)) { return false; } if (!ObjectUtilities.equal(this.markers, that.markers)) { 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/MarkerAxisBand.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 MarkerAxisBand)) {
4
        if (!(obj instanceof DialTextAnnotation)) {
5
            return false;
5
            return false;
6
        }
6
        }
7
        MarkerAxisBand that = (MarkerAxisBand) obj;
7
        DialTextAnnotation that = (DialTextAnnotation) obj;
8
        if (this.topOuterGap != that.topOuterGap) {
8
        if (!this.label.equals(that.label)) {
9
            return false;
9
            return false;
10
        }
10
        }
11
        if (this.topInnerGap != that.topInnerGap) {
11
        if (!this.font.equals(that.font)) {
12
            return false;
12
            return false;
13
        }
13
        }
14
        if (this.bottomInnerGap != that.bottomInnerGap) {
14
        if (!PaintUtilities.equal(this.paint, that.paint)) {
15
            return false;
15
            return false;
16
        }
16
        }
17
        if (this.bottomOuterGap != that.bottomOuterGap) {
17
        if (this.radius != that.radius) {
18
            return false;
18
            return false;
19
        }
19
        }
20
        if (!ObjectUtilities.equal(this.font, that.font)) {
20
        if (this.angle != that.angle) {
21
            return false;
21
            return false;
22
        }
22
        }
23
        if (!ObjectUtilities.equal(this.markers, that.markers)) {
23
        if (!this.anchor.equals(that.anchor)) {
24
            return false;
24
            return false;
25
        }
25
        }
26
        return true;
26
        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)3.7
Clones locationClones are in different classes
Number of node comparisons104
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements12
    Number of unmapped statements in the first code fragment5
    Number of unmapped statements in the second code fragment3
    Time elapsed for statement mapping (ms)4.2
    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 MarkerAxisBand))
    3
    if (!(obj instanceof MarkerAxisBand))
    3
    if (!(obj instanceof DialTextAnnotation))
    Differences
    Expression1Expression2Difference
    org.jfree.chart.axis.MarkerAxisBandorg.jfree.chart.plot.dial.DialTextAnnotationVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jfree.chart.axis.MarkerAxisBand does not match with type org.jfree.chart.plot.dial.DialTextAnnotation
    • Make classes org.jfree.chart.axis.MarkerAxisBand and org.jfree.chart.plot.dial.DialTextAnnotation extend a common superclass
    3
    if (!(obj instanceof DialTextAnnotation))
    4
    return false;
    4
    return false;
                                                                                                          
    5
    DialTextAnnotation that = (DialTextAnnotation)obj;
    5
    MarkerAxisBand that = (MarkerAxisBand)obj;
                                                                                          
                                                                              
    6
    if (!this.label.equals(that.label))
                                    
    7
    return false;
    Preondition Violations
    Unmatched return false;
    7
    return false;
    6
    if (this.topOuterGap != that.topOuterGap)
    6
    if (this.topOuterGap != that.topOuterGap)
    12
    if (this.radius != that.radius)
    Differences
    Expression1Expression2Difference
    topOuterGapradiusVARIABLE_NAME_MISMATCH
    org.jfree.chart.axis.MarkerAxisBandorg.jfree.chart.plot.dial.DialTextAnnotationVARIABLE_TYPE_MISMATCH
    topOuterGapradiusVARIABLE_NAME_MISMATCH
    Preondition Violations
    Type double of variable that.topOuterGap does not match with type double of variable that.radius
    • Make classes org.jfree.chart.axis.MarkerAxisBand and org.jfree.chart.plot.dial.DialTextAnnotation extend a common superclass
    Expression that.topOuterGap 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
    12
    if (this.radius != that.radius)
    7
    return false;
    13
    return false;
    8
    if (this.topInnerGap != that.topInnerGap)
    8
    if (this.topInnerGap != that.topInnerGap)
    14
    if (this.angle != that.angle)
    Differences
    Expression1Expression2Difference
    topInnerGapangleVARIABLE_NAME_MISMATCH
    org.jfree.chart.axis.MarkerAxisBandorg.jfree.chart.plot.dial.DialTextAnnotationVARIABLE_TYPE_MISMATCH
    topInnerGapangleVARIABLE_NAME_MISMATCH
    Preondition Violations
    Type double of variable that.topInnerGap does not match with type double of variable that.angle
    • Make classes org.jfree.chart.axis.MarkerAxisBand and org.jfree.chart.plot.dial.DialTextAnnotation extend a common superclass
    Expression that.topInnerGap 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
    14
    if (this.angle != that.angle)
    9
    return false;
    15
    return false;
    10
    if (this.bottomInnerGap != that.bottomInnerGap)
                                                                                                        
    11
    return false;
    11
    return false;
    Preondition Violations
    Unmatched return false;
                                      
    12
    if (this.bottomOuterGap != that.bottomOuterGap)
                                                                                                        
    13
    return false;
    13
    return false;
    Preondition Violations
    Unmatched return false;
                                      
    14
    if (!ObjectUtilities.equal(this.font, that.font))
    14
    if (!ObjectUtilities.equal(this.font, that.font))
    10
    if (!PaintUtilities.equal(this.paint, that.paint))
    Differences
    Expression1Expression2Difference
    fontpaintVARIABLE_NAME_MISMATCH
    java.awt.Fontjava.awt.PaintVARIABLE_TYPE_MISMATCH
    org.jfree.chart.axis.MarkerAxisBandorg.jfree.chart.plot.dial.DialTextAnnotationVARIABLE_TYPE_MISMATCH
    fontpaintVARIABLE_NAME_MISMATCH
    java.awt.Fontjava.awt.PaintVARIABLE_TYPE_MISMATCH
    org.jfree.util.ObjectUtilitiesorg.jfree.util.PaintUtilitiesVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.awt.Font of variable this.font does not match with type java.awt.Paint of variable this.paint
    • Make classes java.awt.Font and java.awt.Paint extend a common superclass
    Type java.awt.Font of variable that.font does not match with type java.awt.Paint of variable that.paint
    • Make classes org.jfree.chart.axis.MarkerAxisBand and org.jfree.chart.plot.dial.DialTextAnnotation extend a common superclass
    Expression that.font 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 java.awt.Font of variable that.font does not match with type java.awt.Paint of variable that.paint
    • Make classes java.awt.Font 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))
    15
    return false;
    11
    return false;
    16
    if (!ObjectUtilities.equal(this.markers, that.markers))
    16
    if (!ObjectUtilities.equal(this.markers, that.markers))
    8
    if (!this.font.equals(that.font))
    Differences
    Expression1Expression2Difference
    ObjectUtilities.equal(this.markers,that.markers)this.font.equals(that.font)TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression ObjectUtilities.equal(this.markers,that.markers) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression this.font.equals(that.font) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8
    if (!this.font.equals(that.font))
    17
    return false;
    9
    return false;
    Precondition Violations (20)
    Row Violation
    1Type org.jfree.chart.axis.MarkerAxisBand does not match with type org.jfree.chart.plot.dial.DialTextAnnotation
    2Unmatched return false;
    3Type double of variable that.topOuterGap does not match with type double of variable that.radius
    4Expression that.topOuterGap 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 double of variable that.topInnerGap does not match with type double of variable that.angle
    7Expression that.topInnerGap cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Expression that.angle cannot be parameterized, because it has dependencies to/from statements that will be extracted
    9Unmatched return false;
    10Unmatched return false;
    11Type java.awt.Font of variable this.font does not match with type java.awt.Paint of variable this.paint
    12Type java.awt.Font of variable that.font does not match with type java.awt.Paint of variable that.paint
    13Expression that.font cannot be parameterized, because it has dependencies to/from statements that will be extracted
    14Expression that.paint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    15Type java.awt.Font of variable that.font does not match with type java.awt.Paint of variable that.paint
    16Type org.jfree.util.ObjectUtilities does not match with type org.jfree.util.PaintUtilities
    17Expression ObjectUtilities.equal(this.markers,that.markers) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    18Expression this.font.equals(that.font) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    19Not all possible execution flows end in a return statement
    20The refactoring of the clones is infeasible, because classes org.jfree.chart.axis.MarkerAxisBand and org.jfree.chart.plot.dial.DialTextAnnotation do not have a common superclass