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 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/XYStepAreaRenderer.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 XYStepAreaRenderer)) {
4
        if (!(obj instanceof Millisecond)) {
5
            return false;
5
            return false;
6
        }
6
        }
7
        XYStepAreaRenderer that = (XYStepAreaRenderer) obj;
7
        Millisecond that = (Millisecond) obj;
8
        if (this.showOutline != that.showOutline) {
8
        if (this.millisecond != that.millisecond) {
9
            return false;
9
            return false;
10
        }
10
        }
11
        if (this.shapesVisible != that.shapesVisible) {
11
        if (this.second != that.second) {
12
            return false;
12
            return false;
13
        }
13
        }
14
        if (this.shapesFilled != that.shapesFilled) {
14
        if (this.minute != that.minute) {
15
            return false;
15
            return false;
16
        }
16
        }
17
        if (this.plotArea != that.plotArea) {
17
        if (this.hour != that.hour) {
18
            return false;
18
            return false;
19
        }
19
        }
20
        if (this.rangeBase != that.rangeBase) {
20
        if (!this.day.equals(that.day)) {
21
            return false;
21
            return false;
22
        }
22
        }
23
        return super.equals(obj);
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)5.4
Clones locationClones are in different classes
Number of node comparisons86
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements12
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)4.3
    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 XYStepAreaRenderer))
    3
    if (!(obj instanceof XYStepAreaRenderer))
    3
    if (!(obj instanceof Millisecond))
    Differences
    Expression1Expression2Difference
    org.jfree.chart.renderer.xy.XYStepAreaRendererorg.jfree.data.time.MillisecondVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jfree.chart.renderer.xy.XYStepAreaRenderer does not match with type org.jfree.data.time.Millisecond
    • Make classes org.jfree.chart.renderer.xy.XYStepAreaRenderer 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
    XYStepAreaRenderer that = (XYStepAreaRenderer)obj;
                                                                                                          
    6
    if (this.showOutline != that.showOutline)
    6
    if (this.showOutline != that.showOutline)
    6
    if (this.millisecond != that.millisecond)
    Differences
    Expression1Expression2Difference
    showOutlinemillisecondVARIABLE_NAME_MISMATCH
    booleanintVARIABLE_TYPE_MISMATCH
    org.jfree.chart.renderer.xy.XYStepAreaRendererorg.jfree.data.time.MillisecondVARIABLE_TYPE_MISMATCH
    showOutlinemillisecondVARIABLE_NAME_MISMATCH
    booleanintVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type boolean of variable this.showOutline does not match with type int of variable this.millisecond
    Type boolean of variable that.showOutline does not match with type int of variable that.millisecond
    • Make classes org.jfree.chart.renderer.xy.XYStepAreaRenderer 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.millisecond 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 int of variable that.millisecond
    6
    if (this.millisecond != that.millisecond)
    7
    return false;
    7
    return false;
    8
    if (this.shapesVisible != that.shapesVisible)
    8
    if (this.shapesVisible != that.shapesVisible)
    8
    if (this.second != that.second)
    Differences
    Expression1Expression2Difference
    shapesVisiblesecondVARIABLE_NAME_MISMATCH
    booleanbyteVARIABLE_TYPE_MISMATCH
    org.jfree.chart.renderer.xy.XYStepAreaRendererorg.jfree.data.time.MillisecondVARIABLE_TYPE_MISMATCH
    shapesVisiblesecondVARIABLE_NAME_MISMATCH
    booleanbyteVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type boolean of variable this.shapesVisible does not match with type byte of variable this.second
    Type boolean of variable that.shapesVisible does not match with type byte of variable that.second
    • Make classes org.jfree.chart.renderer.xy.XYStepAreaRenderer and org.jfree.data.time.Millisecond extend a common superclass
    Expression that.shapesVisible 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.shapesVisible 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.shapesFilled != that.shapesFilled)
    10
    if (this.shapesFilled != that.shapesFilled)
    10
    if (this.minute != that.minute)
    Differences
    Expression1Expression2Difference
    shapesFilledminuteVARIABLE_NAME_MISMATCH
    booleanbyteVARIABLE_TYPE_MISMATCH
    org.jfree.chart.renderer.xy.XYStepAreaRendererorg.jfree.data.time.MillisecondVARIABLE_TYPE_MISMATCH
    shapesFilledminuteVARIABLE_NAME_MISMATCH
    booleanbyteVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type boolean of variable this.shapesFilled does not match with type byte of variable this.minute
    Type boolean of variable that.shapesFilled does not match with type byte of variable that.minute
    • Make classes org.jfree.chart.renderer.xy.XYStepAreaRenderer and org.jfree.data.time.Millisecond extend a common superclass
    Expression that.shapesFilled 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.shapesFilled 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.plotArea != that.plotArea)
    12
    if (this.plotArea != that.plotArea)
    12
    if (this.hour != that.hour)
    Differences
    Expression1Expression2Difference
    plotAreahourVARIABLE_NAME_MISMATCH
    booleanbyteVARIABLE_TYPE_MISMATCH
    org.jfree.chart.renderer.xy.XYStepAreaRendererorg.jfree.data.time.MillisecondVARIABLE_TYPE_MISMATCH
    plotAreahourVARIABLE_NAME_MISMATCH
    booleanbyteVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type boolean of variable this.plotArea does not match with type byte of variable this.hour
    Type boolean of variable that.plotArea does not match with type byte of variable that.hour
    • Make classes org.jfree.chart.renderer.xy.XYStepAreaRenderer 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.hour 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 byte of variable that.hour
    12
    if (this.hour != that.hour)
    13
    return false;
    13
    return false;
    Precondition Violations (23)
    Row Violation
    1Type org.jfree.chart.renderer.xy.XYStepAreaRenderer does not match with type org.jfree.data.time.Millisecond
    2Type boolean of variable this.showOutline does not match with type int of variable this.millisecond
    3Type boolean of variable that.showOutline does not match with type int of variable that.millisecond
    4Expression that.showOutline 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.showOutline does not match with type int of variable that.millisecond
    7Type boolean of variable this.shapesVisible does not match with type byte of variable this.second
    8Type boolean of variable that.shapesVisible does not match with type byte of variable that.second
    9Expression that.shapesVisible 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.shapesVisible does not match with type byte of variable that.second
    12Type boolean of variable this.shapesFilled does not match with type byte of variable this.minute
    13Type boolean of variable that.shapesFilled does not match with type byte of variable that.minute
    14Expression that.shapesFilled 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.shapesFilled does not match with type byte of variable that.minute
    17Type boolean of variable this.plotArea does not match with type byte of variable this.hour
    18Type boolean of variable that.plotArea does not match with type byte of variable that.hour
    19Expression that.plotArea 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.plotArea does not match with type byte of variable that.hour
    22Not all possible execution flows end in a return statement
    23The refactoring of the clones is infeasible, because classes org.jfree.chart.renderer.xy.XYStepAreaRenderer and org.jfree.data.time.Millisecond do not have a common superclass