if (obj == this) { return true; } if (!(obj instanceof XYStepAreaRenderer)) { return false; } XYStepAreaRenderer that = (XYStepAreaRenderer) obj; if (this.showOutline != that.showOutline) { return false; } if (this.shapesVisible != that.shapesVisible) { return false; } if (this.shapesFilled != that.shapesFilled) { return false; } if (this.plotArea != that.plotArea) { return false; } if (this.rangeBase != that.rangeBase) { return false; } return super.equals(obj);
if (obj == this) { return true; } if (!(obj instanceof ComparableObjectSeries)) { return false; } if (!super.equals(obj)) { return false; } ComparableObjectSeries that = (ComparableObjectSeries) obj; if (this.maximumItemCount != that.maximumItemCount) { return false; } if (this.autoSort != that.autoSort) { return false; } if (this.allowDuplicateXValues != that.allowDuplicateXValues) { return false; } if (!ObjectUtilities.equal(this.data, that.data)) { return false; } return true;
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/xy/XYStepAreaRenderer.java File path: /jfreechart-1.0.10/src/org/jfree/data/ComparableObjectSeries.java
Method name: boolean equals(Object) Method name: boolean equals(Object)
Number of AST nodes: 16 Number of AST nodes: 16
1
if (obj == this) {
1
if (obj == this) {
2
            return true;
2
            return true;
3
        }
3
        }
4
        if (!(obj instanceof XYStepAreaRenderer)) {
4
        if (!(obj instanceof ComparableObjectSeries)) {
5
            return false;
5
            return false;
6
        }
6
        }
7
        XYStepAreaRenderer that = (XYStepAreaRenderer) obj;
7
        
8
        if (this.showOutline != that.showOutline) {
9
            return false;
10
        }
11
        if (this.shapesVisible != that.shapesVisible
8
if (!super.equals(obj)) {
9
            return false;
10
        }
11
        ComparableObjectSeries that = (ComparableObjectSeries) obj;
12
) {
12
        if (this.maximumItemCount != that.maximumItemCount) {
13
            return false;
13
            return false;
14
        }
14
        }
15
        if (this.shapesFilled != that.shapesFilled) {
15
        if (this.autoSort != that.autoSort) {
16
            return false;
16
            return false;
17
        }
17
        }
18
        if (this.plotArea != that.plotArea) {
18
        if (this.allowDuplicateXValues != that.allowDuplicateXValues) {
19
            return false;
19
            return false;
20
        }
20
        }
21
        if (this.rangeBase != that.rangeBase) {
21
        if (!ObjectUtilities.equal(this.data, that.data)) {
22
            return false;
22
            return false;
23
        }
23
        }
24
        return super.equals(obj);
24
        return true;
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)4.0
Clones locationClones are in different classes
Number of node comparisons77
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements10
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment3
    Time elapsed for statement mapping (ms)3.5
    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 XYStepAreaRenderer))
    3
    if (!(obj instanceof XYStepAreaRenderer))
    3
    if (!(obj instanceof ComparableObjectSeries))
    Differences
    Expression1Expression2Difference
    org.jfree.chart.renderer.xy.XYStepAreaRendererorg.jfree.data.ComparableObjectSeriesVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jfree.chart.renderer.xy.XYStepAreaRenderer does not match with type org.jfree.data.ComparableObjectSeries
    • Make classes org.jfree.chart.renderer.xy.XYStepAreaRenderer and org.jfree.data.ComparableObjectSeries extend a common superclass
    3
    if (!(obj instanceof ComparableObjectSeries))
    4
    return false;
    4
    return false;
                                                      
    5
    if (!super.equals(obj))
                                    
    6
    return false;
    Preondition Violations
    Unmatched return false;
    6
    return false;
    5
    XYStepAreaRenderer that = (XYStepAreaRenderer)obj;
                                                                                                          
                                                                                                                          
    7
    ComparableObjectSeries that = (ComparableObjectSeries)obj;
    6
    if (this.showOutline != that.showOutline)
    6
    if (this.showOutline != that.showOutline)
    10
    if (this.autoSort != that.autoSort)
    Differences
    Expression1Expression2Difference
    showOutlineautoSortVARIABLE_NAME_MISMATCH
    org.jfree.chart.renderer.xy.XYStepAreaRendererorg.jfree.data.ComparableObjectSeriesVARIABLE_TYPE_MISMATCH
    showOutlineautoSortVARIABLE_NAME_MISMATCH
    Preondition Violations
    Type boolean of variable that.showOutline does not match with type boolean of variable that.autoSort
    • Make classes org.jfree.chart.renderer.xy.XYStepAreaRenderer and org.jfree.data.ComparableObjectSeries extend a common superclass
    Expression that.showOutline cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.autoSort cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10
    if (this.autoSort != that.autoSort)
    7
    return false;
    11
    return false;
    8
    if (this.shapesVisible != that.shapesVisible)
    8
    if (this.shapesVisible != that.shapesVisible)
    12
    if (this.allowDuplicateXValues != that.allowDuplicateXValues)
    Differences
    Expression1Expression2Difference
    shapesVisibleallowDuplicateXValuesVARIABLE_NAME_MISMATCH
    org.jfree.chart.renderer.xy.XYStepAreaRendererorg.jfree.data.ComparableObjectSeriesVARIABLE_TYPE_MISMATCH
    shapesVisibleallowDuplicateXValuesVARIABLE_NAME_MISMATCH
    Preondition Violations
    Type boolean of variable that.shapesVisible does not match with type boolean of variable that.allowDuplicateXValues
    • Make classes org.jfree.chart.renderer.xy.XYStepAreaRenderer and org.jfree.data.ComparableObjectSeries extend a common superclass
    Expression that.shapesVisible cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.allowDuplicateXValues cannot be parameterized, because it has dependencies to/from statements that will be extracted
    12
    if (this.allowDuplicateXValues != that.allowDuplicateXValues)
    9
    return false;
    13
    return false;
    10
    if (this.shapesFilled != that.shapesFilled)
    10
    if (this.shapesFilled != that.shapesFilled)
    8
    if (this.maximumItemCount != that.maximumItemCount)
    Differences
    Expression1Expression2Difference
    shapesFilledmaximumItemCountVARIABLE_NAME_MISMATCH
    booleanintVARIABLE_TYPE_MISMATCH
    org.jfree.chart.renderer.xy.XYStepAreaRendererorg.jfree.data.ComparableObjectSeriesVARIABLE_TYPE_MISMATCH
    shapesFilledmaximumItemCountVARIABLE_NAME_MISMATCH
    booleanintVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type boolean of variable this.shapesFilled does not match with type int of variable this.maximumItemCount
    Type boolean of variable that.shapesFilled does not match with type int of variable that.maximumItemCount
    • Make classes org.jfree.chart.renderer.xy.XYStepAreaRenderer and org.jfree.data.ComparableObjectSeries extend a common superclass
    Expression that.shapesFilled cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.maximumItemCount cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type boolean of variable that.shapesFilled does not match with type int of variable that.maximumItemCount
    8
    if (this.maximumItemCount != that.maximumItemCount)
    11
    return false;
    9
    return false;
    Precondition Violations (15)
    Row Violation
    1Type org.jfree.chart.renderer.xy.XYStepAreaRenderer does not match with type org.jfree.data.ComparableObjectSeries
    2Unmatched return false;
    3Type boolean of variable that.showOutline does not match with type boolean of variable that.autoSort
    4Expression that.showOutline cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression that.autoSort cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Type boolean of variable that.shapesVisible does not match with type boolean of variable that.allowDuplicateXValues
    7Expression that.shapesVisible cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Expression that.allowDuplicateXValues cannot be parameterized, because it has dependencies to/from statements that will be extracted
    9Type boolean of variable this.shapesFilled does not match with type int of variable this.maximumItemCount
    10Type boolean of variable that.shapesFilled does not match with type int of variable that.maximumItemCount
    11Expression that.shapesFilled cannot be parameterized, because it has dependencies to/from statements that will be extracted
    12Expression that.maximumItemCount cannot be parameterized, because it has dependencies to/from statements that will be extracted
    13Type boolean of variable that.shapesFilled does not match with type int of variable that.maximumItemCount
    14Not all possible execution flows end in a return statement
    15The refactoring of the clones is infeasible, because classes org.jfree.chart.renderer.xy.XYStepAreaRenderer and org.jfree.data.ComparableObjectSeries do not have a common superclass