if (this == obj) { return true; } if (obj instanceof CategoryTick && super.equals(obj)) { CategoryTick that = (CategoryTick) obj; if (!ObjectUtilities.equal(this.category, that.category)) { return false; } if (!ObjectUtilities.equal(this.label, that.label)) { return false; } if (!ObjectUtilities.equal(this.labelAnchor, that.labelAnchor)) { return false; } return true; } return false;
if (obj == this) { return true; } if (!(obj instanceof DialPointer.Pointer)) { return false; } DialPointer.Pointer that = (DialPointer.Pointer) obj; if (this.widthRadius != that.widthRadius) { return false; } if (!PaintUtilities.equal(this.fillPaint, that.fillPaint)) { return false; } if (!PaintUtilities.equal(this.outlinePaint, that.outlinePaint)) { return false; } return super.equals(obj);
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/axis/CategoryTick.java File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/dial/DialPointer.java
Method name: boolean equals(Object) Method name: boolean equals(Object)
Number of AST nodes: 12 Number of AST nodes: 12
1
if (this == obj) {
1
if (obj == this) {
2
            return true;
2
                return true;
3
   
3
    
4
        }
4
        }
5
        if (obj instanceof CategoryTick && super.equals(obj)) {
5
            if (!(obj instanceof 
6
            CategoryTick that = (CategoryTick) obj;   
7
            if (!ObjectUtilities.equal(this.category, that.category)
6
DialPointer.Pointer)) {
7
                return false;
8
            }
9
            DialPointer.Pointer that = (DialPointer.Pointer) obj;
10
            
8
) {
11
            if (this.widthRadius != that.widthRadius) {
9
                return false;   
12
                return false;
10
            }
13
            }
11
            if (!ObjectUtilities.equal(this.label, that.label)) {
14
            if (!PaintUtilities.equal(this.fillPaint, that.fillPaint)) {
12
                return false;   
15
                return false;
13
            }
16
            }
14
            if (!ObjectUtilities.equal(this.labelAnchor, that.labelAnchor)) {
17
            if (!PaintUtilities.equal(this.outlinePaint, that.outlinePaint)) {
15
                return false;   
18
                return false;
16
           }
19
            }
17
            return true;
20
            return 
18
        }
19
        return false;
21
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.0
Clones locationClones are in different classes
Number of node comparisons34
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements6
    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.4
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    4
    CategoryTick that = (CategoryTick)obj;
                                                                                  
                                                                                                              
    5
    DialPointer.Pointer that = (DialPointer.Pointer)obj;
                                                                                          
    6
    if (this.widthRadius != that.widthRadius)
                                    
    7
    return false;
    Preondition Violations
    Unmatched return false;
    7
    return false;
    5
    if (!ObjectUtilities.equal(this.category, that.category))
    5
    if (!ObjectUtilities.equal(this.category, that.category))
    8
    if (!PaintUtilities.equal(this.fillPaint, that.fillPaint))
    Differences
    Expression1Expression2Difference
    categoryfillPaintVARIABLE_NAME_MISMATCH
    java.lang.Comparablejava.awt.PaintVARIABLE_TYPE_MISMATCH
    org.jfree.chart.axis.CategoryTickorg.jfree.chart.plot.dial.DialPointer.PointerVARIABLE_TYPE_MISMATCH
    categoryfillPaintVARIABLE_NAME_MISMATCH
    java.lang.Comparablejava.awt.PaintVARIABLE_TYPE_MISMATCH
    org.jfree.util.ObjectUtilitiesorg.jfree.util.PaintUtilitiesVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.lang.Comparable of variable this.category does not match with type java.awt.Paint of variable this.fillPaint
    • Make classes java.lang.Comparable and java.awt.Paint extend a common superclass
    Type java.lang.Comparable of variable that.category does not match with type java.awt.Paint of variable that.fillPaint
    • Make classes org.jfree.chart.axis.CategoryTick and org.jfree.chart.plot.dial.DialPointer.Pointer extend a common superclass
    Expression that.category 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.Comparable of variable that.category does not match with type java.awt.Paint of variable that.fillPaint
    • Make classes java.lang.Comparable 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.label, that.label))
    7
    if (!ObjectUtilities.equal(this.label, that.label))
    10
    if (!PaintUtilities.equal(this.outlinePaint, that.outlinePaint))
    Differences
    Expression1Expression2Difference
    labeloutlinePaintVARIABLE_NAME_MISMATCH
    org.jfree.text.TextBlockjava.awt.PaintVARIABLE_TYPE_MISMATCH
    org.jfree.chart.axis.CategoryTickorg.jfree.chart.plot.dial.DialPointer.PointerVARIABLE_TYPE_MISMATCH
    labeloutlinePaintVARIABLE_NAME_MISMATCH
    org.jfree.text.TextBlockjava.awt.PaintVARIABLE_TYPE_MISMATCH
    org.jfree.util.ObjectUtilitiesorg.jfree.util.PaintUtilitiesVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jfree.text.TextBlock of variable this.label does not match with type java.awt.Paint of variable this.outlinePaint
    • Make classes org.jfree.text.TextBlock and java.awt.Paint extend a common superclass
    Type org.jfree.text.TextBlock of variable that.label does not match with type java.awt.Paint of variable that.outlinePaint
    • Make classes org.jfree.chart.axis.CategoryTick and org.jfree.chart.plot.dial.DialPointer.Pointer extend a common superclass
    Expression that.label 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.text.TextBlock of variable that.label does not match with type java.awt.Paint of variable that.outlinePaint
    • Make classes org.jfree.text.TextBlock 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.labelAnchor, that.labelAnchor))
    9
    if (!ObjectUtilities.equal(this.labelAnchor, that.labelAnchor))
    3
    if (!(obj instanceof DialPointer.Pointer))
    Differences
    Expression1Expression2Difference
    ObjectUtilities.equal(this.labelAnchor,that.labelAnchor)(obj instanceof DialPointer.Pointer)TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression ObjectUtilities.equal(this.labelAnchor,that.labelAnchor) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3
    if (!(obj instanceof DialPointer.Pointer))
    10
    return false;
    4
    return false;
    Precondition Violations (15)
    Row Violation
    1Unmatched return false;
    2Type java.lang.Comparable of variable this.category does not match with type java.awt.Paint of variable this.fillPaint
    3Type java.lang.Comparable of variable that.category does not match with type java.awt.Paint of variable that.fillPaint
    4Expression that.category cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression that.fillPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Type java.lang.Comparable of variable that.category does not match with type java.awt.Paint of variable that.fillPaint
    7Type org.jfree.util.ObjectUtilities does not match with type org.jfree.util.PaintUtilities
    8Type org.jfree.text.TextBlock of variable this.label does not match with type java.awt.Paint of variable this.outlinePaint
    9Type org.jfree.text.TextBlock of variable that.label does not match with type java.awt.Paint of variable that.outlinePaint
    10Expression that.label cannot be parameterized, because it has dependencies to/from statements that will be extracted
    11Expression that.outlinePaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    12Type org.jfree.text.TextBlock of variable that.label does not match with type java.awt.Paint of variable that.outlinePaint
    13Type org.jfree.util.ObjectUtilities does not match with type org.jfree.util.PaintUtilities
    14Expression ObjectUtilities.equal(this.labelAnchor,that.labelAnchor) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    15Not all possible execution flows end in a return statement