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 Millisecond)) { return false; } Millisecond that = (Millisecond) obj; if (this.millisecond != that.millisecond) { return false; } if (this.second != that.second) { return false; } if (this.minute != that.minute) { return false; } if (this.hour != that.hour) { return false; } if (!this.day.equals(that.day)) { 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/time/Millisecond.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 Millisecond)) {
5
            return false;   
5
            return false;
6
        }
6
        }
7
        XYAreaRenderer that = (XYAreaRenderer) obj;
7
        Millisecond that = (Millisecond) obj;
8
        if (this.plotArea != that.plotArea) {
8
        if (this.millisecond != that.millisecond) {
9
            return false;   
9
            return false;
10
        }
10
        }
11
        if (this.plotLines != that.plotLines) {
11
        if (this.second != that.second) {
12
            return false;   
12
            return false;
13
        }
13
        }
14
        if (this.plotShapes != that.plotShapes) {
14
        if (this.minute != that.minute) {
15
            return false;   
15
            return false;
16
        }
16
        }
17
        if (this.showOutline != that.showOutline) {
17
        if (this.hour != that.hour) {
18
            return false;   
18
            return false;
19
        }
19
        }
20
        if (!ShapeUtilities.equal(this.legendArea, that.legendArea)) {
20
        if (!this.day.equals(that.day)) {
21
            return false;   
21
            return false;
22
        }
22
        }
23
        return true;
23
        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.8
Clones locationClones are in different classes
Number of node comparisons95
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements15
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)10.1
    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 XYAreaRenderer))
    3
    if (!(obj instanceof XYAreaRenderer))
    3
    if (!(obj instanceof Millisecond))
    Differences
    Expression1Expression2Difference
    org.jfree.chart.renderer.xy.XYAreaRendererorg.jfree.data.time.MillisecondVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jfree.chart.renderer.xy.XYAreaRenderer does not match with type org.jfree.data.time.Millisecond
    • Make classes org.jfree.chart.renderer.xy.XYAreaRenderer and org.jfree.data.time.Millisecond extend a common superclass
    3
    if (!(obj instanceof Millisecond))
    4
    return false;
    4
    return false;
                                                                              
    5
    Millisecond that = (Millisecond)obj;
    5
    XYAreaRenderer that = (XYAreaRenderer)obj;
                                                                                          
    6
    if (this.plotArea != that.plotArea)
    6
    if (this.plotArea != that.plotArea)
    6
    if (this.millisecond != that.millisecond)
    Differences
    Expression1Expression2Difference
    plotAreamillisecondVARIABLE_NAME_MISMATCH
    booleanintVARIABLE_TYPE_MISMATCH
    org.jfree.chart.renderer.xy.XYAreaRendererorg.jfree.data.time.MillisecondVARIABLE_TYPE_MISMATCH
    plotAreamillisecondVARIABLE_NAME_MISMATCH
    booleanintVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type boolean of variable this.plotArea does not match with type int of variable this.millisecond
    Type boolean of variable that.plotArea does not match with type int of variable that.millisecond
    • Make classes org.jfree.chart.renderer.xy.XYAreaRenderer and org.jfree.data.time.Millisecond extend a common superclass
    Expression that.plotArea cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.millisecond cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type boolean of variable that.plotArea does not match with type int of variable that.millisecond
    6
    if (this.millisecond != that.millisecond)
    7
    return false;
    7
    return false;
    8
    if (this.plotLines != that.plotLines)
    8
    if (this.plotLines != that.plotLines)
    8
    if (this.second != that.second)
    Differences
    Expression1Expression2Difference
    plotLinessecondVARIABLE_NAME_MISMATCH
    booleanbyteVARIABLE_TYPE_MISMATCH
    org.jfree.chart.renderer.xy.XYAreaRendererorg.jfree.data.time.MillisecondVARIABLE_TYPE_MISMATCH
    plotLinessecondVARIABLE_NAME_MISMATCH
    booleanbyteVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type boolean of variable this.plotLines does not match with type byte of variable this.second
    Type boolean of variable that.plotLines does not match with type byte of variable that.second
    • Make classes org.jfree.chart.renderer.xy.XYAreaRenderer and org.jfree.data.time.Millisecond extend a common superclass
    Expression that.plotLines cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.second cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type boolean of variable that.plotLines does not match with type byte of variable that.second
    8
    if (this.second != that.second)
    9
    return false;
    9
    return false;
    10
    if (this.plotShapes != that.plotShapes)
    10
    if (this.plotShapes != that.plotShapes)
    10
    if (this.minute != that.minute)
    Differences
    Expression1Expression2Difference
    plotShapesminuteVARIABLE_NAME_MISMATCH
    booleanbyteVARIABLE_TYPE_MISMATCH
    org.jfree.chart.renderer.xy.XYAreaRendererorg.jfree.data.time.MillisecondVARIABLE_TYPE_MISMATCH
    plotShapesminuteVARIABLE_NAME_MISMATCH
    booleanbyteVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type boolean of variable this.plotShapes does not match with type byte of variable this.minute
    Type boolean of variable that.plotShapes does not match with type byte of variable that.minute
    • Make classes org.jfree.chart.renderer.xy.XYAreaRenderer and org.jfree.data.time.Millisecond extend a common superclass
    Expression that.plotShapes cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.minute 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 byte of variable that.minute
    10
    if (this.minute != that.minute)
    11
    return false;
    11
    return false;
    12
    if (this.showOutline != that.showOutline)
    12
    if (this.showOutline != that.showOutline)
    12
    if (this.hour != that.hour)
    Differences
    Expression1Expression2Difference
    showOutlinehourVARIABLE_NAME_MISMATCH
    booleanbyteVARIABLE_TYPE_MISMATCH
    org.jfree.chart.renderer.xy.XYAreaRendererorg.jfree.data.time.MillisecondVARIABLE_TYPE_MISMATCH
    showOutlinehourVARIABLE_NAME_MISMATCH
    booleanbyteVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type boolean of variable this.showOutline does not match with type byte of variable this.hour
    Type boolean of variable that.showOutline does not match with type byte of variable that.hour
    • Make classes org.jfree.chart.renderer.xy.XYAreaRenderer and org.jfree.data.time.Millisecond extend a common superclass
    Expression that.showOutline cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.hour cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type boolean of variable that.showOutline does not match with type byte of variable that.hour
    12
    if (this.hour != that.hour)
    13
    return false;
    13
    return false;
    14
    if (!ShapeUtilities.equal(this.legendArea, that.legendArea))
    14
    if (!ShapeUtilities.equal(this.legendArea, that.legendArea))
    14
    if (!this.day.equals(that.day))
    Differences
    Expression1Expression2Difference
    ShapeUtilities.equal(this.legendArea,that.legendArea)this.day.equals(that.day)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
    Expression this.day.equals(that.day) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    14
    if (!this.day.equals(that.day))
    15
    return false;
    15
    return false;
    16
    return true;
    16
    return true;
    Precondition Violations (24)
    Row Violation
    1Type org.jfree.chart.renderer.xy.XYAreaRenderer does not match with type org.jfree.data.time.Millisecond
    2Type boolean of variable this.plotArea does not match with type int of variable this.millisecond
    3Type boolean of variable that.plotArea does not match with type int of variable that.millisecond
    4Expression that.plotArea cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression that.millisecond cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Type boolean of variable that.plotArea does not match with type int of variable that.millisecond
    7Type boolean of variable this.plotLines does not match with type byte of variable this.second
    8Type boolean of variable that.plotLines does not match with type byte of variable that.second
    9Expression that.plotLines cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10Expression that.second cannot be parameterized, because it has dependencies to/from statements that will be extracted
    11Type boolean of variable that.plotLines does not match with type byte of variable that.second
    12Type boolean of variable this.plotShapes does not match with type byte of variable this.minute
    13Type boolean of variable that.plotShapes does not match with type byte of variable that.minute
    14Expression that.plotShapes cannot be parameterized, because it has dependencies to/from statements that will be extracted
    15Expression that.minute cannot be parameterized, because it has dependencies to/from statements that will be extracted
    16Type boolean of variable that.plotShapes does not match with type byte of variable that.minute
    17Type boolean of variable this.showOutline does not match with type byte of variable this.hour
    18Type boolean of variable that.showOutline does not match with type byte of variable that.hour
    19Expression that.showOutline cannot be parameterized, because it has dependencies to/from statements that will be extracted
    20Expression that.hour cannot be parameterized, because it has dependencies to/from statements that will be extracted
    21Type boolean of variable that.showOutline does not match with type byte of variable that.hour
    22Expression ShapeUtilities.equal(this.legendArea,that.legendArea) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    23Expression this.day.equals(that.day) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    24The refactoring of the clones is infeasible, because classes org.jfree.chart.renderer.xy.XYAreaRenderer and org.jfree.data.time.Millisecond do not have a common superclass