if (obj == this) { return true; } if (!(obj instanceof SymbolAxis)) { return false; } SymbolAxis that = (SymbolAxis) obj; if (!this.symbols.equals(that.symbols)) { return false; } if (this.gridBandsVisible != that.gridBandsVisible) { return false; } if (!PaintUtilities.equal(this.gridBandPaint, that.gridBandPaint)) { return false; } if (!PaintUtilities.equal(this.gridBandAlternatePaint, that.gridBandAlternatePaint)) { return false; } return super.equals(obj);
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/SymbolAxis.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 (obj == this) {
1
if (obj == this) {
2
            return true;
2
            return true;
3
        }
3
        }
4
        if (!(obj instanceof SymbolAxis)) {
4
        if (!(obj instanceof DialCap)) {
5
            return false;
5
            return false;
6
        }
6
        }
7
        SymbolAxis that = (SymbolAxis) obj;
7
        DialCap that = (DialCap) obj;
8
        if (!this.symbols.equals(that.symbols)) {
8
        if (this.radius != that.radius) {
9
            return false;
9
            return false;
10
        }
10
        }
11
        if (this.gridBandsVisible != that.gridBandsVisible) {
11
        if (!PaintUtilities.equal(this.fillPaint, that.fillPaint)) {
12
            return false;
12
            return false;
13
        }
13
        }
14
        if (!PaintUtilities.equal(this.gridBandPaint, that.gridBandPaint)) {
14
        if (!PaintUtilities.equal(this.outlinePaint, that.outlinePaint)) {
15
            return false;
15
            return false;
16
        }
16
        }
17
        if (!PaintUtilities.equal(this.gridBandAlternatePaint, 
17
        if (!
18
                that.gridBandAlternatePaint)) {
18
this.outlineStroke.equals(that.outlineStroke)) {
19
            return false;
19
            return false;
20
        }
20
        }
21
        return super.equals(obj);
21
        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.0
Clones locationClones are in different classes
Number of node comparisons76
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements14
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)4.7
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (obj == this)
    1
    if (obj == this)
    2
    return true;
    2
    return true;
    3
    if (!(obj instanceof SymbolAxis))
    3
    if (!(obj instanceof SymbolAxis))
    3
    if (!(obj instanceof DialCap))
    Differences
    Expression1Expression2Difference
    org.jfree.chart.axis.SymbolAxisorg.jfree.chart.plot.dial.DialCapSUBCLASS_TYPE_MISMATCH
    3
    if (!(obj instanceof DialCap))
    4
    return false;
    4
    return false;
    5
    SymbolAxis that = (SymbolAxis)obj;
    5
    SymbolAxis that = (SymbolAxis)obj;
    5
    DialCap that = (DialCap)obj;
    Differences
    Expression1Expression2Difference
    org.jfree.chart.axis.SymbolAxisorg.jfree.chart.plot.dial.DialCapSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.axis.SymbolAxisorg.jfree.chart.plot.dial.DialCapSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.axis.SymbolAxisorg.jfree.chart.plot.dial.DialCapSUBCLASS_TYPE_MISMATCH
    5
    DialCap that = (DialCap)obj;
    6
    if (!this.symbols.equals(that.symbols))
    6
    if (!this.symbols.equals(that.symbols))
    12
    if (!this.outlineStroke.equals(that.outlineStroke))
    Differences
    Expression1Expression2Difference
    org.jfree.chart.axis.SymbolAxisorg.jfree.chart.plot.dial.DialCapSUBCLASS_TYPE_MISMATCH
    symbolsoutlineStrokeVARIABLE_NAME_MISMATCH
    java.util.Listjava.awt.StrokeVARIABLE_TYPE_MISMATCH
    symbolsoutlineStrokeVARIABLE_NAME_MISMATCH
    java.util.Listjava.awt.StrokeVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Expression that.symbols cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.outlineStroke cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type java.util.List of variable that.symbols does not match with type java.awt.Stroke of variable that.outlineStroke
    • Make classes java.util.List and java.awt.Stroke extend a common superclass
    Type java.util.List of variable this.symbols does not match with type java.awt.Stroke of variable this.outlineStroke
    • Make classes java.util.List and java.awt.Stroke extend a common superclass
    12
    if (!this.outlineStroke.equals(that.outlineStroke))
    7
    return false;
    13
    return false;
    8
    if (this.gridBandsVisible != that.gridBandsVisible)
    8
    if (this.gridBandsVisible != that.gridBandsVisible)
    6
    if (this.radius != that.radius)
    Differences
    Expression1Expression2Difference
    gridBandsVisibleradiusVARIABLE_NAME_MISMATCH
    booleandoubleVARIABLE_TYPE_MISMATCH
    org.jfree.chart.axis.SymbolAxisorg.jfree.chart.plot.dial.DialCapSUBCLASS_TYPE_MISMATCH
    gridBandsVisibleradiusVARIABLE_NAME_MISMATCH
    booleandoubleVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type boolean of variable this.gridBandsVisible does not match with type double of variable this.radius
    Expression that.gridBandsVisible 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
    Type boolean of variable that.gridBandsVisible does not match with type double of variable that.radius
    6
    if (this.radius != that.radius)
    9
    return false;
    7
    return false;
    10
    if (!PaintUtilities.equal(this.gridBandPaint, that.gridBandPaint))
    10
    if (!PaintUtilities.equal(this.gridBandPaint, that.gridBandPaint))
    10
    if (!PaintUtilities.equal(this.outlinePaint, that.outlinePaint))
    Differences
    Expression1Expression2Difference
    gridBandPaintoutlinePaintVARIABLE_NAME_MISMATCH
    org.jfree.chart.axis.SymbolAxisorg.jfree.chart.plot.dial.DialCapSUBCLASS_TYPE_MISMATCH
    gridBandPaintoutlinePaintVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression that.gridBandPaint 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
    10
    if (!PaintUtilities.equal(this.outlinePaint, that.outlinePaint))
    11
    return false;
    11
    return false;
    12
    if (!PaintUtilities.equal(this.gridBandAlternatePaint, that.gridBandAlternatePaint))
    12
    if (!PaintUtilities.equal(this.gridBandAlternatePaint, that.gridBandAlternatePaint))
    8
    if (!PaintUtilities.equal(this.fillPaint, that.fillPaint))
    Differences
    Expression1Expression2Difference
    gridBandAlternatePaintfillPaintVARIABLE_NAME_MISMATCH
    org.jfree.chart.axis.SymbolAxisorg.jfree.chart.plot.dial.DialCapSUBCLASS_TYPE_MISMATCH
    gridBandAlternatePaintfillPaintVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression that.gridBandAlternatePaint 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
    8
    if (!PaintUtilities.equal(this.fillPaint, that.fillPaint))
    13
    return false;
    9
    return false;
    14
    return super.equals(obj);
    14
    return super.equals(obj);
    14
    return super.equals(obj);
    Preondition Violations
    Super method call return super.equals(obj); cannot be extracted from method
    Super method call return super.equals(obj); cannot be extracted from method
    14
    return super.equals(obj);
    Precondition Violations (15)
    Row Violation
    1Expression that.symbols cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression that.outlineStroke cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Type java.util.List of variable that.symbols does not match with type java.awt.Stroke of variable that.outlineStroke
    4Type java.util.List of variable this.symbols does not match with type java.awt.Stroke of variable this.outlineStroke
    5Type boolean of variable this.gridBandsVisible does not match with type double of variable this.radius
    6Expression that.gridBandsVisible cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression that.radius cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Type boolean of variable that.gridBandsVisible does not match with type double of variable that.radius
    9Expression that.gridBandPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10Expression that.outlinePaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    11Expression that.gridBandAlternatePaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    12Expression that.fillPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    13Super method call return super.equals(obj); cannot be extracted from method
    14Super method call return super.equals(obj); cannot be extracted from method
    15The refactoring of the clones is infeasible, because classes org.jfree.chart.axis.SymbolAxis and org.jfree.chart.plot.dial.DialCap do not have a common superclass