if (obj == this) { return true; } if (!(obj instanceof CyclicNumberAxis)) { return false; } if (!super.equals(obj)) { return false; } CyclicNumberAxis that = (CyclicNumberAxis) obj; if (this.period != that.period) { return false; } if (this.offset != that.offset) { return false; } if (!PaintUtilities.equal(this.advanceLinePaint, that.advanceLinePaint)) { return false; } if (!ObjectUtilities.equal(this.advanceLineStroke, that.advanceLineStroke)) { return false; } if (this.advanceLineVisible != that.advanceLineVisible) { return false; } if (this.boundMappedToLastCycle != that.boundMappedToLastCycle) { return false; } return true;
if (obj == this) { return true; } if (!(obj instanceof ScatterRenderer)) { return false; } ScatterRenderer that = (ScatterRenderer) obj; if (!ObjectUtilities.equal(this.seriesShapesFilled, that.seriesShapesFilled)) { return false; } if (this.baseShapesFilled != that.baseShapesFilled) { return false; } if (this.useFillPaint != that.useFillPaint) { return false; } if (this.drawOutlines != that.drawOutlines) { return false; } if (this.useOutlinePaint != that.useOutlinePaint) { return false; } if (this.useSeriesOffset != that.useSeriesOffset) { return false; } if (this.itemMargin != that.itemMargin) { return false; } return super.equals(obj);
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/axis/CyclicNumberAxis.java File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/category/ScatterRenderer.java
Method name: boolean equals(Object) Method name: boolean equals(Object)
Number of AST nodes: 20 Number of AST nodes: 20
1
if (obj == this) {
1
if (obj == this) {
2
            return true;
2
            return true;
3
        }
3
        }
4
        if (!(obj instanceof CyclicNumberAxis)) {
4
        if (!(obj instanceof ScatterRenderer)) {
5
            return false;
5
            return false;
6
        }
6
        }
7
        if (!super.equals(obj)) {
7
        
8
            return false;
8
ScatterRenderer that = (ScatterRenderer) obj;
9
        if (!ObjectUtilities.equal(this.seriesShapesFilled,
9
        }
10
        
10
        CyclicNumberAxis that = (CyclicNumberAxis) obj;
11
        that.seriesShapesFilled)) {
12
            return false;
11
      
13
        }
12
        if (this.period != that.period) {
14
        if (this.baseShapesFilled != that.baseShapesFilled) {
13
            return false;
15
            return false;
14
        }
16
        }
15
        if (this.offset != that.offset) {
17
        if (this.useFillPaint != that.useFillPaint) {
16
            return false;
18
            return false;
17
        }
19
        }
18
        if (!PaintUtilities.equal(this.advanceLinePaint, 
20
        if (
19
                that.advanceLinePaint)) {
20
            return false;
21
        }
22
        if (!ObjectUtilities.equal(this.advanceLineStroke, 
23
                that.advanceLineStroke)
21
this.drawOutlines != that.drawOutlines) {
22
            return false;
23
        }
24
) {
24
        if (this.useOutlinePaint != that.useOutlinePaint) {
25
            return false;
25
            return false;
26
        }
26
        }
27
        if (this.advanceLineVisible != that.advanceLineVisible) {
27
        if (this.useSeriesOffset != that.useSeriesOffset) {
28
            return false;
28
            return false;
29
        }
29
        }
30
        if (this.boundMappedToLastCycle != that.boundMappedToLastCycle) {
30
        if (this.itemMargin != that.itemMargin) {
31
            return false;
31
            return false;
32
        }
32
        }
33
        return true;
33
        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)8.9
Clones locationClones are in different classes
Number of node comparisons124
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements14
    Number of unmapped statements in the first code fragment5
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)6.6
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    1
    if (obj == this)
    1
    if (obj == this)
    2
    return true;
    2
    return true;
    3
    if (!(obj instanceof CyclicNumberAxis))
    3
    if (!(obj instanceof CyclicNumberAxis))
    3
    if (!(obj instanceof ScatterRenderer))
    Differences
    Expression1Expression2Difference
    org.jfree.chart.axis.CyclicNumberAxisorg.jfree.chart.renderer.category.ScatterRendererSUBCLASS_TYPE_MISMATCH
    3
    if (!(obj instanceof ScatterRenderer))
    4
    return false;
    4
    return false;
                                                                                              
    5
    ScatterRenderer that = (ScatterRenderer)obj;
    5
    if (!super.equals(obj))
    5
    if (!super.equals(obj))
    6
    if (!ObjectUtilities.equal(this.seriesShapesFilled, that.seriesShapesFilled))
    Differences
    Expression1Expression2Difference
    super.equals(obj)ObjectUtilities.equal(this.seriesShapesFilled,that.seriesShapesFilled)TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression ObjectUtilities.equal(this.seriesShapesFilled,that.seriesShapesFilled) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Super method call if(!super.equals(obj)) cannot be extracted from method
    6
    if (!ObjectUtilities.equal(this.seriesShapesFilled, that.seriesShapesFilled))
    6
    return false;
    7
    return false;
    7
    CyclicNumberAxis that = (CyclicNumberAxis)obj;
                                                                                                  
    8
    if (this.period != that.period)
    8
    if (this.period != that.period)
    8
    if (this.baseShapesFilled != that.baseShapesFilled)
    Differences
    Expression1Expression2Difference
    periodbaseShapesFilledVARIABLE_NAME_MISMATCH
    doublebooleanVARIABLE_TYPE_MISMATCH
    org.jfree.chart.axis.CyclicNumberAxisorg.jfree.chart.renderer.category.ScatterRendererSUBCLASS_TYPE_MISMATCH
    periodbaseShapesFilledVARIABLE_NAME_MISMATCH
    doublebooleanVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type double of variable this.period does not match with type boolean of variable this.baseShapesFilled
    Expression that.period cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.baseShapesFilled cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type double of variable that.period does not match with type boolean of variable that.baseShapesFilled
    8
    if (this.baseShapesFilled != that.baseShapesFilled)
    9
    return false;
    9
    return false;
    10
    if (this.offset != that.offset)
    10
    if (this.offset != that.offset)
    10
    if (this.useFillPaint != that.useFillPaint)
    Differences
    Expression1Expression2Difference
    offsetuseFillPaintVARIABLE_NAME_MISMATCH
    doublebooleanVARIABLE_TYPE_MISMATCH
    org.jfree.chart.axis.CyclicNumberAxisorg.jfree.chart.renderer.category.ScatterRendererSUBCLASS_TYPE_MISMATCH
    offsetuseFillPaintVARIABLE_NAME_MISMATCH
    doublebooleanVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type double of variable this.offset does not match with type boolean of variable this.useFillPaint
    Expression that.offset cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.useFillPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type double of variable that.offset does not match with type boolean of variable that.useFillPaint
    10
    if (this.useFillPaint != that.useFillPaint)
    11
    return false;
    11
    return false;
    12
    if (!PaintUtilities.equal(this.advanceLinePaint, that.advanceLinePaint))
                                                                                                                                                        
    13
    return false;
    13
    return false;
    Preondition Violations
    Unmatched return false;
                                      
    14
    if (!ObjectUtilities.equal(this.advanceLineStroke, that.advanceLineStroke))
                                                                                                                                                              
    15
    return false;
    15
    return false;
    Preondition Violations
    Unmatched return false;
                                      
    16
    if (this.advanceLineVisible != that.advanceLineVisible)
    16
    if (this.advanceLineVisible != that.advanceLineVisible)
    14
    if (this.useOutlinePaint != that.useOutlinePaint)
    Differences
    Expression1Expression2Difference
    advanceLineVisibleuseOutlinePaintVARIABLE_NAME_MISMATCH
    org.jfree.chart.axis.CyclicNumberAxisorg.jfree.chart.renderer.category.ScatterRendererSUBCLASS_TYPE_MISMATCH
    advanceLineVisibleuseOutlinePaintVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression that.advanceLineVisible cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.useOutlinePaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    14
    if (this.useOutlinePaint != that.useOutlinePaint)
    17
    return false;
    15
    return false;
    18
    if (this.boundMappedToLastCycle != that.boundMappedToLastCycle)
    18
    if (this.boundMappedToLastCycle != that.boundMappedToLastCycle)
    12
    if (this.drawOutlines != that.drawOutlines)
    Differences
    Expression1Expression2Difference
    boundMappedToLastCycledrawOutlinesVARIABLE_NAME_MISMATCH
    org.jfree.chart.axis.CyclicNumberAxisorg.jfree.chart.renderer.category.ScatterRendererSUBCLASS_TYPE_MISMATCH
    boundMappedToLastCycledrawOutlinesVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression that.boundMappedToLastCycle cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.drawOutlines cannot be parameterized, because it has dependencies to/from statements that will be extracted
    12
    if (this.drawOutlines != that.drawOutlines)
    19
    return false;
    13
    return false;
    Precondition Violations (18)
    Row Violation
    1Expression ObjectUtilities.equal(this.seriesShapesFilled,that.seriesShapesFilled) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Super method call if(!super.equals(obj)) cannot be extracted from method
    3Type double of variable this.period does not match with type boolean of variable this.baseShapesFilled
    4Expression that.period cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression that.baseShapesFilled cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Type double of variable that.period does not match with type boolean of variable that.baseShapesFilled
    7Type double of variable this.offset does not match with type boolean of variable this.useFillPaint
    8Expression that.offset cannot be parameterized, because it has dependencies to/from statements that will be extracted
    9Expression that.useFillPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10Type double of variable that.offset does not match with type boolean of variable that.useFillPaint
    11Unmatched return false;
    12Unmatched return false;
    13Expression that.advanceLineVisible cannot be parameterized, because it has dependencies to/from statements that will be extracted
    14Expression that.useOutlinePaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    15Expression that.boundMappedToLastCycle cannot be parameterized, because it has dependencies to/from statements that will be extracted
    16Expression that.drawOutlines cannot be parameterized, because it has dependencies to/from statements that will be extracted
    17Not all possible execution flows end in a return statement
    18The refactoring of the clones is infeasible, because classes org.jfree.chart.axis.CyclicNumberAxis and org.jfree.chart.renderer.category.ScatterRenderer do not have a common superclass