if (obj == this) { return true; } if (!(obj instanceof XYAreaRenderer)) { return false; } XYAreaRenderer that = (XYAreaRenderer) obj; if (this.plotArea != that.plotArea) { return false; } if (this.plotLines != that.plotLines) { return false; } if (this.plotShapes != that.plotShapes) { return false; } if (this.showOutline != that.showOutline) { return false; } if (!ShapeUtilities.equal(this.legendArea, that.legendArea)) { return false; } return true;
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/XYAreaRenderer.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 XYAreaRenderer)) {
4
        if (!(obj instanceof ComparableObjectSeries)) {
5
            return false;   
5
            return false;
6
        }
6
        }
7
        XYAreaRenderer that = (XYAreaRenderer) obj;
7
        
8
        if (this.plotArea != that.plotArea) {
8
if (!super.equals(obj)) {
9
            return false;   
9
            return false;
10
        }
10
        }
11
        ComparableObjectSeries that = (ComparableObjectSeries) obj;
11
        if (this.plotLines != that.plotLines) {
12
        if (this.maximumItemCount != that.maximumItemCount) {
12
            return false;   
13
            return false;
13
        }
14
        }
14
        if (this.plotShapes != that.plotShapes) {
15
        if (this.autoSort != that.autoSort) {
15
            return false;   
16
            return false;
16
        }
17
        }
17
        if (this.showOutline != that.showOutline) {
18
        if (this.allowDuplicateXValues != that.allowDuplicateXValues) {
18
            return false;   
19
            return false;
19
        }
20
        }
20
        if (!ShapeUtilities.equal(this.legendArea, that.legendArea)) {
21
        if (!ObjectUtilities.equal(this.data, that.data)) {
21
            return false;   
22
            return false;
22
        }
23
        }
23
        return true;
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.1
Clones locationClones are in different classes
Number of node comparisons80
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements12
    Number of unmapped statements in the first code fragment3
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)4.4
    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 XYAreaRenderer))
    3
    if (!(obj instanceof XYAreaRenderer))
    3
    if (!(obj instanceof ComparableObjectSeries))
    Differences
    Expression1Expression2Difference
    org.jfree.chart.renderer.xy.XYAreaRendererorg.jfree.data.ComparableObjectSeriesVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jfree.chart.renderer.xy.XYAreaRenderer does not match with type org.jfree.data.ComparableObjectSeries
    • Make classes org.jfree.chart.renderer.xy.XYAreaRenderer and org.jfree.data.ComparableObjectSeries extend a common superclass
    3
    if (!(obj instanceof ComparableObjectSeries))
    4
    return false;
    4
    return false;
    5
    XYAreaRenderer that = (XYAreaRenderer)obj;
                                                                                          
                                                                                                                          
    7
    ComparableObjectSeries that = (ComparableObjectSeries)obj;
    6
    if (this.plotArea != that.plotArea)
    6
    if (this.plotArea != that.plotArea)
    10
    if (this.autoSort != that.autoSort)
    Differences
    Expression1Expression2Difference
    plotAreaautoSortVARIABLE_NAME_MISMATCH
    org.jfree.chart.renderer.xy.XYAreaRendererorg.jfree.data.ComparableObjectSeriesVARIABLE_TYPE_MISMATCH
    plotAreaautoSortVARIABLE_NAME_MISMATCH
    Preondition Violations
    Type boolean of variable that.plotArea does not match with type boolean of variable that.autoSort
    • Make classes org.jfree.chart.renderer.xy.XYAreaRenderer and org.jfree.data.ComparableObjectSeries extend a common superclass
    Expression that.plotArea 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.plotLines != that.plotLines)
    8
    if (this.plotLines != that.plotLines)
    12
    if (this.allowDuplicateXValues != that.allowDuplicateXValues)
    Differences
    Expression1Expression2Difference
    plotLinesallowDuplicateXValuesVARIABLE_NAME_MISMATCH
    org.jfree.chart.renderer.xy.XYAreaRendererorg.jfree.data.ComparableObjectSeriesVARIABLE_TYPE_MISMATCH
    plotLinesallowDuplicateXValuesVARIABLE_NAME_MISMATCH
    Preondition Violations
    Type boolean of variable that.plotLines does not match with type boolean of variable that.allowDuplicateXValues
    • Make classes org.jfree.chart.renderer.xy.XYAreaRenderer and org.jfree.data.ComparableObjectSeries extend a common superclass
    Expression that.plotLines 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.plotShapes != that.plotShapes)
    10
    if (this.plotShapes != that.plotShapes)
    8
    if (this.maximumItemCount != that.maximumItemCount)
    Differences
    Expression1Expression2Difference
    plotShapesmaximumItemCountVARIABLE_NAME_MISMATCH
    booleanintVARIABLE_TYPE_MISMATCH
    org.jfree.chart.renderer.xy.XYAreaRendererorg.jfree.data.ComparableObjectSeriesVARIABLE_TYPE_MISMATCH
    plotShapesmaximumItemCountVARIABLE_NAME_MISMATCH
    booleanintVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type boolean of variable this.plotShapes does not match with type int of variable this.maximumItemCount
    Type boolean of variable that.plotShapes does not match with type int of variable that.maximumItemCount
    • Make classes org.jfree.chart.renderer.xy.XYAreaRenderer and org.jfree.data.ComparableObjectSeries extend a common superclass
    Expression that.plotShapes 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.plotShapes does not match with type int of variable that.maximumItemCount
    8
    if (this.maximumItemCount != that.maximumItemCount)
    11
    return false;
    9
    return false;
    12
    if (this.showOutline != that.showOutline)
                                                                                            
    13
    return false;
    13
    return false;
    Preondition Violations
    Unmatched return false;
                                      
    14
    if (!ShapeUtilities.equal(this.legendArea, that.legendArea))
    14
    if (!ShapeUtilities.equal(this.legendArea, that.legendArea))
    5
    if (!super.equals(obj))
    Differences
    Expression1Expression2Difference
    ShapeUtilities.equal(this.legendArea,that.legendArea)super.equals(obj)TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression ShapeUtilities.equal(this.legendArea,that.legendArea) 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
    5
    if (!super.equals(obj))
    15
    return false;
    6
    return false;
    Precondition Violations (17)
    Row Violation
    1Type org.jfree.chart.renderer.xy.XYAreaRenderer does not match with type org.jfree.data.ComparableObjectSeries
    2Type boolean of variable that.plotArea does not match with type boolean of variable that.autoSort
    3Expression that.plotArea cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression that.autoSort cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Type boolean of variable that.plotLines does not match with type boolean of variable that.allowDuplicateXValues
    6Expression that.plotLines cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression that.allowDuplicateXValues cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Type boolean of variable this.plotShapes does not match with type int of variable this.maximumItemCount
    9Type boolean of variable that.plotShapes does not match with type int of variable that.maximumItemCount
    10Expression that.plotShapes cannot be parameterized, because it has dependencies to/from statements that will be extracted
    11Expression that.maximumItemCount cannot be parameterized, because it has dependencies to/from statements that will be extracted
    12Type boolean of variable that.plotShapes does not match with type int of variable that.maximumItemCount
    13Unmatched return false;
    14Expression ShapeUtilities.equal(this.legendArea,that.legendArea) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    15Super method call if(!super.equals(obj)) cannot be extracted from method
    16Not all possible execution flows end in a return statement
    17The refactoring of the clones is infeasible, because classes org.jfree.chart.renderer.xy.XYAreaRenderer and org.jfree.data.ComparableObjectSeries do not have a common superclass