if (this == obj) { return true; } if (obj instanceof Tick) { Tick t = (Tick) obj; if (!ObjectUtilities.equal(this.text, t.text)) { return false; } if (!ObjectUtilities.equal(this.textAnchor, t.textAnchor)) { return false; } if (!ObjectUtilities.equal(this.rotationAnchor, t.rotationAnchor)) { return false; } if (!(this.angle == t.angle)) { return false; } return true; } return false;
if (obj == this) { return true; } if (!(obj instanceof StandardDialFrame)) { return false; } StandardDialFrame that = (StandardDialFrame) obj; if (!PaintUtilities.equal(this.backgroundPaint, that.backgroundPaint)) { return false; } if (!PaintUtilities.equal(this.foregroundPaint, that.foregroundPaint)) { return false; } if (this.radius != that.radius) { return false; } if (!this.stroke.equals(that.stroke)) { return false; } return super.equals(obj);
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/axis/Tick.java File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/dial/StandardDialFrame.java
Method name: boolean equals(Object) Method name: boolean equals(Object)
Number of AST nodes: 14 Number of AST nodes: 14
1
if (this == obj) {
1
if (obj == this) {
2
            return true;   
2
            return true;
3
        }
3
        }
4
        if (obj instanceof Tick) {
4
        if (!(obj instanceof 
5
            Tick t = (Tick) obj;   
6
    
5
StandardDialFrame)) {
6
            return false;
7
        }
8
        StandardDialFrame that = (StandardDialFrame) obj;
7
        if (!ObjectUtilities.equal(this.text, t.text)) {
9
        if (!PaintUtilities.equal(this.backgroundPaint, that.backgroundPaint)) {
8
                return false;   
10
            return false;
9
            }
11
        
10
   
12
}
11
         if (!ObjectUtilities.equal(this.textAnchor, t.textAnchor)) {
13
        if (!PaintUtilities.equal(this.foregroundPaint, that.foregroundPaint)) {
12
                return false;   
14
            return false;
13
  
14
          }
15
        }
15
            if (!ObjectUtilities.equal(this.rotationAnchor, t.rotationAnchor)) {
16
        if (this.radius != that.radius) {
16
                return false;   
17
            return false;
17
    
18
        }
18
        }
19
            if (!(this.angle == t.angle)) {
19
        if (!this.stroke.equals(that.stroke)) {
20
                return false;   
20
            return false;
21
   
22
         }
21
        }
23
            return true;
22
        return 
24
        }
25
        return false;
23
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)2.3
Clones locationClones are in different classes
Number of node comparisons55
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements8
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment3
    Time elapsed for statement mapping (ms)3.0
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    4
    Tick t = (Tick)obj;
                                            
                                                                                                      
    5
    StandardDialFrame that = (StandardDialFrame)obj;
    5
    if (!ObjectUtilities.equal(this.text, t.text))
    5
    if (!ObjectUtilities.equal(this.text, t.text))
    6
    if (!PaintUtilities.equal(this.backgroundPaint, that.backgroundPaint))
    Differences
    Expression1Expression2Difference
    textbackgroundPaintVARIABLE_NAME_MISMATCH
    java.lang.Stringjava.awt.PaintVARIABLE_TYPE_MISMATCH
    tthatVARIABLE_NAME_MISMATCH
    org.jfree.chart.axis.Tickorg.jfree.chart.plot.dial.StandardDialFrameVARIABLE_TYPE_MISMATCH
    textbackgroundPaintVARIABLE_NAME_MISMATCH
    java.lang.Stringjava.awt.PaintVARIABLE_TYPE_MISMATCH
    org.jfree.util.ObjectUtilitiesorg.jfree.util.PaintUtilitiesVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.lang.String of variable this.text does not match with type java.awt.Paint of variable this.backgroundPaint
    • Make classes java.lang.String and java.awt.Paint extend a common superclass
    Expression t.text cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.backgroundPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type java.lang.String of variable t.text does not match with type java.awt.Paint of variable that.backgroundPaint
    • Make classes org.jfree.chart.axis.Tick and org.jfree.chart.plot.dial.StandardDialFrame extend a common superclass
    Expression t.text cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.backgroundPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type java.lang.String of variable t.text does not match with type java.awt.Paint of variable that.backgroundPaint
    • Make classes java.lang.String 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
    6
    if (!PaintUtilities.equal(this.backgroundPaint, that.backgroundPaint))
    6
    return false;
    7
    return false;
    7
    if (!ObjectUtilities.equal(this.textAnchor, t.textAnchor))
    7
    if (!ObjectUtilities.equal(this.textAnchor, t.textAnchor))
    8
    if (!PaintUtilities.equal(this.foregroundPaint, that.foregroundPaint))
    Differences
    Expression1Expression2Difference
    textAnchorforegroundPaintVARIABLE_NAME_MISMATCH
    org.jfree.ui.TextAnchorjava.awt.PaintVARIABLE_TYPE_MISMATCH
    tthatVARIABLE_NAME_MISMATCH
    org.jfree.chart.axis.Tickorg.jfree.chart.plot.dial.StandardDialFrameVARIABLE_TYPE_MISMATCH
    textAnchorforegroundPaintVARIABLE_NAME_MISMATCH
    org.jfree.ui.TextAnchorjava.awt.PaintVARIABLE_TYPE_MISMATCH
    org.jfree.util.ObjectUtilitiesorg.jfree.util.PaintUtilitiesVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jfree.ui.TextAnchor of variable this.textAnchor does not match with type java.awt.Paint of variable this.foregroundPaint
    • Make classes org.jfree.ui.TextAnchor and java.awt.Paint extend a common superclass
    Expression t.textAnchor cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.foregroundPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type org.jfree.ui.TextAnchor of variable t.textAnchor does not match with type java.awt.Paint of variable that.foregroundPaint
    • Make classes org.jfree.chart.axis.Tick and org.jfree.chart.plot.dial.StandardDialFrame extend a common superclass
    Expression t.textAnchor cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.foregroundPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type org.jfree.ui.TextAnchor of variable t.textAnchor does not match with type java.awt.Paint of variable that.foregroundPaint
    • Make classes org.jfree.ui.TextAnchor 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
    8
    if (!PaintUtilities.equal(this.foregroundPaint, that.foregroundPaint))
    8
    return false;
    9
    return false;
    9
    if (!ObjectUtilities.equal(this.rotationAnchor, t.rotationAnchor))
    9
    if (!ObjectUtilities.equal(this.rotationAnchor, t.rotationAnchor))
    3
    if (!(obj instanceof StandardDialFrame))
    Differences
    Expression1Expression2Difference
    ObjectUtilities.equal(this.rotationAnchor,t.rotationAnchor)(obj instanceof StandardDialFrame)TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression ObjectUtilities.equal(this.rotationAnchor,t.rotationAnchor) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3
    if (!(obj instanceof StandardDialFrame))
    10
    return false;
    4
    return false;
                                                                        
    10
    if (this.radius != that.radius)
                                      
    11
    return false;
    Preondition Violations
    Unmatched return false;
    11
    return false;
    11
    if (!(this.angle == t.angle))
    11
    if (!(this.angle == t.angle))
    12
    if (!this.stroke.equals(that.stroke))
    Differences
    Expression1Expression2Difference
    (this.angle == t.angle)this.stroke.equals(that.stroke)TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression (this.angle == t.angle) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression this.stroke.equals(that.stroke) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    12
    if (!this.stroke.equals(that.stroke))
    12
    return false;
    13
    return false;
    Precondition Violations (21)
    Row Violation
    1Type java.lang.String of variable this.text does not match with type java.awt.Paint of variable this.backgroundPaint
    2Expression t.text cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression that.backgroundPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Type java.lang.String of variable t.text does not match with type java.awt.Paint of variable that.backgroundPaint
    5Expression t.text cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression that.backgroundPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Type java.lang.String of variable t.text does not match with type java.awt.Paint of variable that.backgroundPaint
    8Type org.jfree.util.ObjectUtilities does not match with type org.jfree.util.PaintUtilities
    9Type org.jfree.ui.TextAnchor of variable this.textAnchor does not match with type java.awt.Paint of variable this.foregroundPaint
    10Expression t.textAnchor cannot be parameterized, because it has dependencies to/from statements that will be extracted
    11Expression that.foregroundPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    12Type org.jfree.ui.TextAnchor of variable t.textAnchor does not match with type java.awt.Paint of variable that.foregroundPaint
    13Expression t.textAnchor cannot be parameterized, because it has dependencies to/from statements that will be extracted
    14Expression that.foregroundPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    15Type org.jfree.ui.TextAnchor of variable t.textAnchor does not match with type java.awt.Paint of variable that.foregroundPaint
    16Type org.jfree.util.ObjectUtilities does not match with type org.jfree.util.PaintUtilities
    17Expression ObjectUtilities.equal(this.rotationAnchor,t.rotationAnchor) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    18Unmatched return false;
    19Expression (this.angle == t.angle) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    20Expression this.stroke.equals(that.stroke) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    21Not all possible execution flows end in a return statement