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 GanttRenderer)) { return false; } GanttRenderer that = (GanttRenderer) obj; if (!PaintUtilities.equal(this.completePaint, that.completePaint)) { return false; } if (!PaintUtilities.equal(this.incompletePaint, that.incompletePaint)) { return false; } if (this.startPercent != that.startPercent) { return false; } if (this.endPercent != that.endPercent) { 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/renderer/category/GanttRenderer.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 GanttRenderer)) {
5
            return false;
5
            return false;
6
        }
6
        }
7
        SymbolAxis that = (SymbolAxis) obj;
7
        GanttRenderer that = (GanttRenderer) obj;
8
        if (!this.symbols.equals(that.symbols)) {
8
        if (!PaintUtilities.equal(this.completePaint, that.completePaint)) {
9
            return false;
9
            return false;
10
        }
10
        }
11
        if (this.gridBandsVisible != that.gridBandsVisible) {
11
        if (!PaintUtilities.equal(this.incompletePaint, that.incompletePaint)) {
12
            return false;
12
            return false;
13
        }
13
        }
14
        if (!PaintUtilities.equal(this.gridBandPaint, that.gridBandPaint)) {
14
        if (this.startPercent != that.startPercent) {
15
            return false;
15
            return false;
16
        }
16
        }
17
        if (!PaintUtilities.equal(this.gridBandAlternatePaint, 
17
        if (
18
                that.gridBandAlternatePaint)) {
18
this.endPercent != that.endPercent) {
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.5
Clones locationClones are in different classes
Number of node comparisons61
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements11
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)5.8
    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 GanttRenderer))
    Differences
    Expression1Expression2Difference
    org.jfree.chart.axis.SymbolAxisorg.jfree.chart.renderer.category.GanttRendererSUBCLASS_TYPE_MISMATCH
    3
    if (!(obj instanceof GanttRenderer))
    4
    return false;
    4
    return false;
    5
    SymbolAxis that = (SymbolAxis)obj;
    5
    SymbolAxis that = (SymbolAxis)obj;
    5
    GanttRenderer that = (GanttRenderer)obj;
    Differences
    Expression1Expression2Difference
    org.jfree.chart.axis.SymbolAxisorg.jfree.chart.renderer.category.GanttRendererSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.axis.SymbolAxisorg.jfree.chart.renderer.category.GanttRendererSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.axis.SymbolAxisorg.jfree.chart.renderer.category.GanttRendererSUBCLASS_TYPE_MISMATCH
    5
    GanttRenderer that = (GanttRenderer)obj;
    6
    if (!this.symbols.equals(that.symbols))
    6
    if (!this.symbols.equals(that.symbols))
    6
    if (!PaintUtilities.equal(this.completePaint, that.completePaint))
    Differences
    Expression1Expression2Difference
    this.symbols.equals(that.symbols)PaintUtilities.equal(this.completePaint,that.completePaint)TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression this.symbols.equals(that.symbols) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression PaintUtilities.equal(this.completePaint,that.completePaint) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6
    if (!PaintUtilities.equal(this.completePaint, that.completePaint))
    7
    return false;
    7
    return false;
    8
    if (this.gridBandsVisible != that.gridBandsVisible)
    8
    if (this.gridBandsVisible != that.gridBandsVisible)
    10
    if (this.startPercent != that.startPercent)
    Differences
    Expression1Expression2Difference
    gridBandsVisiblestartPercentVARIABLE_NAME_MISMATCH
    booleandoubleVARIABLE_TYPE_MISMATCH
    org.jfree.chart.axis.SymbolAxisorg.jfree.chart.renderer.category.GanttRendererSUBCLASS_TYPE_MISMATCH
    gridBandsVisiblestartPercentVARIABLE_NAME_MISMATCH
    booleandoubleVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type boolean of variable this.gridBandsVisible does not match with type double of variable this.startPercent
    Expression that.gridBandsVisible cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.startPercent 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.startPercent
    10
    if (this.startPercent != that.startPercent)
    9
    return false;
    11
    return false;
    10
    if (!PaintUtilities.equal(this.gridBandPaint, that.gridBandPaint))
    10
    if (!PaintUtilities.equal(this.gridBandPaint, that.gridBandPaint))
    8
    if (!PaintUtilities.equal(this.incompletePaint, that.incompletePaint))
    Differences
    Expression1Expression2Difference
    gridBandPaintincompletePaintVARIABLE_NAME_MISMATCH
    org.jfree.chart.axis.SymbolAxisorg.jfree.chart.renderer.category.GanttRendererSUBCLASS_TYPE_MISMATCH
    gridBandPaintincompletePaintVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression that.gridBandPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.incompletePaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8
    if (!PaintUtilities.equal(this.incompletePaint, that.incompletePaint))
    11
    return false;
    9
    return false;
    Precondition Violations (11)
    Row Violation
    1Expression this.symbols.equals(that.symbols) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression PaintUtilities.equal(this.completePaint,that.completePaint) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Type boolean of variable this.gridBandsVisible does not match with type double of variable this.startPercent
    4Expression that.gridBandsVisible cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression that.startPercent cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Type boolean of variable that.gridBandsVisible does not match with type double of variable that.startPercent
    7Expression that.gridBandPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Expression that.incompletePaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    9Clone fragment #1 returns variable that with type org.jfree.chart.axis.SymbolAxis , while Clone fragment #2 returns variable that with type org.jfree.chart.renderer.category.GanttRenderer
    10Not all possible execution flows end in a return statement
    11The refactoring of the clones is infeasible, because classes org.jfree.chart.axis.SymbolAxis and org.jfree.chart.renderer.category.GanttRenderer do not have a common superclass