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 DialCap)) { return false; } DialCap that = (DialCap) obj; if (this.radius != that.radius) { return false; } if (!PaintUtilities.equal(this.fillPaint, that.fillPaint)) { return false; } if (!PaintUtilities.equal(this.outlinePaint, that.outlinePaint)) { return false; } if (!this.outlineStroke.equals(that.outlineStroke)) { 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/DialCap.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 DialCap)) {
5
            Tick t = (Tick
5
            return false;
6
        }
6
) obj;   
7
        DialCap that = (DialCap) obj;
7
            if (!ObjectUtilities.equal(this.text, t.text)) {
8
        if (this.radius != that.radius) {
8
                return false;   
9
            return false;
9
            }
10
        }
10
            if (!ObjectUtilities.equal(this.textAnchor, t.textAnchor)) {
11
        if (!PaintUtilities.equal(this.fillPaint, that.fillPaint)) {
11
                return false;   
12
            return false;
12
  
13
          }
13
        }
14
            if (!ObjectUtilities.equal(this.rotationAnchor, t.rotationAnchor)) {
14
        if (!PaintUtilities.equal(this.outlinePaint, that.outlinePaint)) {
15
                return false;   
15
            return false;
16
            }
16
        
17
   
17
}
18
         if (!(this.angle == t.angle)) {
18
        if (!this.outlineStroke.equals(that.outlineStroke)) {
19
                return false;   
19
            return false;
20
            }
20
        
21
    
21
}
22
        return true;
22
        return 
23
        }
24
        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.2
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)2.6
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    4
    Tick t = (Tick)obj;
                                            
                                                              
    5
    DialCap that = (DialCap)obj;
                                                                      
    6
    if (this.radius != that.radius)
                                    
    7
    return false;
    Preondition Violations
    Unmatched return false;
    7
    return false;
    5
    if (!ObjectUtilities.equal(this.text, t.text))
    5
    if (!ObjectUtilities.equal(this.text, t.text))
    8
    if (!PaintUtilities.equal(this.fillPaint, that.fillPaint))
    Differences
    Expression1Expression2Difference
    textfillPaintVARIABLE_NAME_MISMATCH
    java.lang.Stringjava.awt.PaintVARIABLE_TYPE_MISMATCH
    tthatVARIABLE_NAME_MISMATCH
    org.jfree.chart.axis.Tickorg.jfree.chart.plot.dial.DialCapVARIABLE_TYPE_MISMATCH
    textfillPaintVARIABLE_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.fillPaint
    • 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.fillPaint 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.fillPaint
    • Make classes org.jfree.chart.axis.Tick and org.jfree.chart.plot.dial.DialCap extend a common superclass
    Expression t.text cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.fillPaint 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.fillPaint
    • 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
    8
    if (!PaintUtilities.equal(this.fillPaint, that.fillPaint))
    6
    return false;
    9
    return false;
    7
    if (!ObjectUtilities.equal(this.textAnchor, t.textAnchor))
    7
    if (!ObjectUtilities.equal(this.textAnchor, t.textAnchor))
    10
    if (!PaintUtilities.equal(this.outlinePaint, that.outlinePaint))
    Differences
    Expression1Expression2Difference
    textAnchoroutlinePaintVARIABLE_NAME_MISMATCH
    org.jfree.ui.TextAnchorjava.awt.PaintVARIABLE_TYPE_MISMATCH
    tthatVARIABLE_NAME_MISMATCH
    org.jfree.chart.axis.Tickorg.jfree.chart.plot.dial.DialCapVARIABLE_TYPE_MISMATCH
    textAnchoroutlinePaintVARIABLE_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.outlinePaint
    • 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.outlinePaint 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.outlinePaint
    • Make classes org.jfree.chart.axis.Tick and org.jfree.chart.plot.dial.DialCap extend a common superclass
    Expression t.textAnchor cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.outlinePaint 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.outlinePaint
    • 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
    10
    if (!PaintUtilities.equal(this.outlinePaint, that.outlinePaint))
    8
    return false;
    11
    return false;
    9
    if (!ObjectUtilities.equal(this.rotationAnchor, t.rotationAnchor))
    9
    if (!ObjectUtilities.equal(this.rotationAnchor, t.rotationAnchor))
    3
    if (!(obj instanceof DialCap))
    Differences
    Expression1Expression2Difference
    ObjectUtilities.equal(this.rotationAnchor,t.rotationAnchor)(obj instanceof DialCap)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 DialCap))
    10
    return false;
    4
    return false;
    11
    if (!(this.angle == t.angle))
    11
    if (!(this.angle == t.angle))
    12
    if (!this.outlineStroke.equals(that.outlineStroke))
    Differences
    Expression1Expression2Difference
    (this.angle == t.angle)this.outlineStroke.equals(that.outlineStroke)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.outlineStroke.equals(that.outlineStroke) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    12
    if (!this.outlineStroke.equals(that.outlineStroke))
    12
    return false;
    13
    return false;
    Precondition Violations (21)
    Row Violation
    1Unmatched return false;
    2Type java.lang.String of variable this.text does not match with type java.awt.Paint of variable this.fillPaint
    3Expression t.text cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression that.fillPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Type java.lang.String of variable t.text does not match with type java.awt.Paint of variable that.fillPaint
    6Expression t.text cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression that.fillPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Type java.lang.String of variable t.text does not match with type java.awt.Paint of variable that.fillPaint
    9Type org.jfree.util.ObjectUtilities does not match with type org.jfree.util.PaintUtilities
    10Type org.jfree.ui.TextAnchor of variable this.textAnchor does not match with type java.awt.Paint of variable this.outlinePaint
    11Expression t.textAnchor cannot be parameterized, because it has dependencies to/from statements that will be extracted
    12Expression that.outlinePaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    13Type org.jfree.ui.TextAnchor of variable t.textAnchor does not match with type java.awt.Paint of variable that.outlinePaint
    14Expression t.textAnchor cannot be parameterized, because it has dependencies to/from statements that will be extracted
    15Expression that.outlinePaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    16Type org.jfree.ui.TextAnchor of variable t.textAnchor does not match with type java.awt.Paint of variable that.outlinePaint
    17Type org.jfree.util.ObjectUtilities does not match with type org.jfree.util.PaintUtilities
    18Expression ObjectUtilities.equal(this.rotationAnchor,t.rotationAnchor) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    19Expression (this.angle == t.angle) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    20Expression this.outlineStroke.equals(that.outlineStroke) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    21Not all possible execution flows end in a return statement