if (obj == this) { return true; } if (!(obj instanceof ExtendedCategoryAxis)) { return false; } ExtendedCategoryAxis that = (ExtendedCategoryAxis) obj; if (!this.sublabelFont.equals(that.sublabelFont)) { return false; } if (!PaintUtilities.equal(this.sublabelPaint, that.sublabelPaint)) { return false; } if (!this.sublabels.equals(that.sublabels)) { return false; } return super.equals(obj);
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; }
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/axis/ExtendedCategoryAxis.java File path: /jfreechart-1.0.10/src/org/jfree/chart/axis/Tick.java
Method name: boolean equals(Object) Method name: boolean equals(Object)
Number of AST nodes: 12 Number of AST nodes: 11
1
if (obj == this) {
1
if (obj instanceof Tick) {
2
            return true;
2
            
3
        }
4
        if (!(obj instanceof ExtendedCategoryAxis
3
Tick t = (Tick) obj;   
5
)) {
4
            if (!ObjectUtilities.equal(this.text, t.text)) {
6
            return false;
5
                return false;
7
        }
8
        ExtendedCategoryAxis that = (ExtendedCategoryAxis) obj;
9
        if (!this.sublabelFont.equals(that.sublabelFont
6
   
7
            }
10
)) {
8
            if (!ObjectUtilities.equal(this.textAnchor, t.textAnchor)) {
11
            return false;
9
                return false;   
12
        }
10
         
11
   }
13
        if (!PaintUtilities.equal(this.sublabelPaint, that.sublabelPaint)) {
12
            if (!ObjectUtilities.equal(this.rotationAnchor, t.rotationAnchor)) {
14
            return false;
13
                return false;   
15
        }
14
            }
16
        if (!this.sublabels.equals(that.sublabels)) {
15
            if (!(this.angle == t.angle)) {
17
            return false;
16
                return false;   
18
        }
17
        
18
    }
19
        return super.equals(obj);
19
            return true;
20
        }
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)1.7
Clones locationClones are in different classes
Number of node comparisons51
  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 fragment1
    Time elapsed for statement mapping (ms)5.7
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
                                            
    4
    Tick t = (Tick)obj;
    3
    if (!(obj instanceof ExtendedCategoryAxis))
    3
    if (!(obj instanceof ExtendedCategoryAxis))
    11
    if (!(this.angle == t.angle))
    Differences
    Expression1Expression2Difference
    obj instanceof ExtendedCategoryAxisthis.angle == t.angleTYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression this.angle == t.angle cannot be parameterized, because it has dependencies to/from statements that will be extracted
    11
    if (!(this.angle == t.angle))
    4
    return false;
    12
    return false;
    5
    ExtendedCategoryAxis that = (ExtendedCategoryAxis)obj;
                                                                                                                  
    6
    if (!this.sublabelFont.equals(that.sublabelFont))
    6
    if (!this.sublabelFont.equals(that.sublabelFont))
    7
    if (!ObjectUtilities.equal(this.textAnchor, t.textAnchor))
    Differences
    Expression1Expression2Difference
    this.sublabelFont.equals(that.sublabelFont)ObjectUtilities.equal(this.textAnchor,t.textAnchor)TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression this.sublabelFont.equals(that.sublabelFont) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression ObjectUtilities.equal(this.textAnchor,t.textAnchor) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7
    if (!ObjectUtilities.equal(this.textAnchor, t.textAnchor))
    7
    return false;
    8
    return false;
    8
    if (!PaintUtilities.equal(this.sublabelPaint, that.sublabelPaint))
    8
    if (!PaintUtilities.equal(this.sublabelPaint, that.sublabelPaint))
    9
    if (!ObjectUtilities.equal(this.rotationAnchor, t.rotationAnchor))
    Differences
    Expression1Expression2Difference
    sublabelPaintrotationAnchorVARIABLE_NAME_MISMATCH
    java.awt.Paintorg.jfree.ui.TextAnchorVARIABLE_TYPE_MISMATCH
    thattVARIABLE_NAME_MISMATCH
    org.jfree.chart.axis.ExtendedCategoryAxisorg.jfree.chart.axis.TickVARIABLE_TYPE_MISMATCH
    sublabelPaintrotationAnchorVARIABLE_NAME_MISMATCH
    java.awt.Paintorg.jfree.ui.TextAnchorVARIABLE_TYPE_MISMATCH
    org.jfree.util.PaintUtilitiesorg.jfree.util.ObjectUtilitiesVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.awt.Paint of variable this.sublabelPaint does not match with type org.jfree.ui.TextAnchor of variable this.rotationAnchor
    • Make classes java.awt.Paint and org.jfree.ui.TextAnchor extend a common superclass
    Expression that.sublabelPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression t.rotationAnchor cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type java.awt.Paint of variable that.sublabelPaint does not match with type org.jfree.ui.TextAnchor of variable t.rotationAnchor
    • Make classes org.jfree.chart.axis.ExtendedCategoryAxis and org.jfree.chart.axis.Tick extend a common superclass
    Expression that.sublabelPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression t.rotationAnchor cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type java.awt.Paint of variable that.sublabelPaint does not match with type org.jfree.ui.TextAnchor of variable t.rotationAnchor
    • Make classes java.awt.Paint and org.jfree.ui.TextAnchor extend a common superclass
    Type org.jfree.util.PaintUtilities does not match with type org.jfree.util.ObjectUtilities
    • Make classes org.jfree.util.PaintUtilities and org.jfree.util.ObjectUtilities extend a common superclass
    9
    if (!ObjectUtilities.equal(this.rotationAnchor, t.rotationAnchor))
    9
    return false;
    10
    return false;
    10
    if (!this.sublabels.equals(that.sublabels))
    10
    if (!this.sublabels.equals(that.sublabels))
    5
    if (!ObjectUtilities.equal(this.text, t.text))
    Differences
    Expression1Expression2Difference
    this.sublabels.equals(that.sublabels)ObjectUtilities.equal(this.text,t.text)TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression this.sublabels.equals(that.sublabels) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression ObjectUtilities.equal(this.text,t.text) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5
    if (!ObjectUtilities.equal(this.text, t.text))
    11
    return false;
    6
    return false;
    Precondition Violations (14)
    Row Violation
    1Expression this.angle == t.angle cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression this.sublabelFont.equals(that.sublabelFont) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression ObjectUtilities.equal(this.textAnchor,t.textAnchor) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Type java.awt.Paint of variable this.sublabelPaint does not match with type org.jfree.ui.TextAnchor of variable this.rotationAnchor
    5Expression that.sublabelPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression t.rotationAnchor cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Type java.awt.Paint of variable that.sublabelPaint does not match with type org.jfree.ui.TextAnchor of variable t.rotationAnchor
    8Expression that.sublabelPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    9Expression t.rotationAnchor cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10Type java.awt.Paint of variable that.sublabelPaint does not match with type org.jfree.ui.TextAnchor of variable t.rotationAnchor
    11Type org.jfree.util.PaintUtilities does not match with type org.jfree.util.ObjectUtilities
    12Expression this.sublabels.equals(that.sublabels) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    13Expression ObjectUtilities.equal(this.text,t.text) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    14Not all possible execution flows end in a return statement