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 Title)) { return false; } if (!super.equals(obj)) { return false; } Title that = (Title) obj; if (this.position != that.position) { return false; } if (this.horizontalAlignment != that.horizontalAlignment) { return false; } if (this.verticalAlignment != that.verticalAlignment) { return false; } if (this.notify != that.notify) { 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/chart/title/Title.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 Title)) {
5
            return false;
5
            return false;
6
        }
6
        }
7
        XYStepAreaRenderer that = (XYStepAreaRenderer) obj;
7
        
8
        if (this.showOutline != that.showOutline) {
8
if (!super.equals(obj)) {
9
            return false;
9
            return false;   
10
        }
10
        }
11
        if (this.shapesVisible != that.shapesVisible
11
        Title that = (Title) obj;
12
) {
12
        if (this.position != that.position) {
13
            return false;
13
            return false;
14
        }
14
        }
15
        if (this.shapesFilled != that.shapesFilled) {
15
        if (this.horizontalAlignment != that.horizontalAlignment) {
16
            return false;
16
            return false;
17
        }
17
        }
18
        if (this.plotArea != that.plotArea) {
18
        if (this.verticalAlignment != that.verticalAlignment) {
19
            return false;
19
            return false;
20
        }
20
        }
21
        if (this.rangeBase != that.rangeBase) {
21
        if (this.notify != that.notify) {
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)7.3
Clones locationClones are in different classes
Number of node comparisons89
  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 fragment3
    Time elapsed for statement mapping (ms)5.2
    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 Title))
    Differences
    Expression1Expression2Difference
    org.jfree.chart.renderer.xy.XYStepAreaRendererorg.jfree.chart.title.TitleVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jfree.chart.renderer.xy.XYStepAreaRenderer does not match with type org.jfree.chart.title.Title
    • Make classes org.jfree.chart.renderer.xy.XYStepAreaRenderer and org.jfree.chart.title.Title extend a common superclass
    3
    if (!(obj instanceof Title))
    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
    Title that = (Title)obj;
    6
    if (this.showOutline != that.showOutline)
    6
    if (this.showOutline != that.showOutline)
    14
    if (this.notify != that.notify)
    Differences
    Expression1Expression2Difference
    showOutlinenotifyVARIABLE_NAME_MISMATCH
    org.jfree.chart.renderer.xy.XYStepAreaRendererorg.jfree.chart.title.TitleVARIABLE_TYPE_MISMATCH
    showOutlinenotifyVARIABLE_NAME_MISMATCH
    Preondition Violations
    Type boolean of variable that.showOutline does not match with type boolean of variable that.notify
    • Make classes org.jfree.chart.renderer.xy.XYStepAreaRenderer and org.jfree.chart.title.Title extend a common superclass
    Expression that.showOutline cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.notify cannot be parameterized, because it has dependencies to/from statements that will be extracted
    14
    if (this.notify != that.notify)
    7
    return false;
    15
    return false;
    8
    if (this.shapesVisible != that.shapesVisible)
    8
    if (this.shapesVisible != that.shapesVisible)
    8
    if (this.position != that.position)
    Differences
    Expression1Expression2Difference
    shapesVisiblepositionVARIABLE_NAME_MISMATCH
    booleanorg.jfree.ui.RectangleEdgeVARIABLE_TYPE_MISMATCH
    org.jfree.chart.renderer.xy.XYStepAreaRendererorg.jfree.chart.title.TitleVARIABLE_TYPE_MISMATCH
    shapesVisiblepositionVARIABLE_NAME_MISMATCH
    booleanorg.jfree.ui.RectangleEdgeVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type boolean of variable this.shapesVisible does not match with type org.jfree.ui.RectangleEdge of variable this.position
    Type boolean of variable that.shapesVisible does not match with type org.jfree.ui.RectangleEdge of variable that.position
    • Make classes org.jfree.chart.renderer.xy.XYStepAreaRenderer and org.jfree.chart.title.Title extend a common superclass
    Expression that.shapesVisible cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.position 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 org.jfree.ui.RectangleEdge of variable that.position
    8
    if (this.position != that.position)
    9
    return false;
    9
    return false;
    10
    if (this.shapesFilled != that.shapesFilled)
    10
    if (this.shapesFilled != that.shapesFilled)
    10
    if (this.horizontalAlignment != that.horizontalAlignment)
    Differences
    Expression1Expression2Difference
    shapesFilledhorizontalAlignmentVARIABLE_NAME_MISMATCH
    booleanorg.jfree.ui.HorizontalAlignmentVARIABLE_TYPE_MISMATCH
    org.jfree.chart.renderer.xy.XYStepAreaRendererorg.jfree.chart.title.TitleVARIABLE_TYPE_MISMATCH
    shapesFilledhorizontalAlignmentVARIABLE_NAME_MISMATCH
    booleanorg.jfree.ui.HorizontalAlignmentVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type boolean of variable this.shapesFilled does not match with type org.jfree.ui.HorizontalAlignment of variable this.horizontalAlignment
    Type boolean of variable that.shapesFilled does not match with type org.jfree.ui.HorizontalAlignment of variable that.horizontalAlignment
    • Make classes org.jfree.chart.renderer.xy.XYStepAreaRenderer and org.jfree.chart.title.Title extend a common superclass
    Expression that.shapesFilled cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.horizontalAlignment 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 org.jfree.ui.HorizontalAlignment of variable that.horizontalAlignment
    10
    if (this.horizontalAlignment != that.horizontalAlignment)
    11
    return false;
    11
    return false;
    12
    if (this.plotArea != that.plotArea)
    12
    if (this.plotArea != that.plotArea)
    12
    if (this.verticalAlignment != that.verticalAlignment)
    Differences
    Expression1Expression2Difference
    plotAreaverticalAlignmentVARIABLE_NAME_MISMATCH
    booleanorg.jfree.ui.VerticalAlignmentVARIABLE_TYPE_MISMATCH
    org.jfree.chart.renderer.xy.XYStepAreaRendererorg.jfree.chart.title.TitleVARIABLE_TYPE_MISMATCH
    plotAreaverticalAlignmentVARIABLE_NAME_MISMATCH
    booleanorg.jfree.ui.VerticalAlignmentVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type boolean of variable this.plotArea does not match with type org.jfree.ui.VerticalAlignment of variable this.verticalAlignment
    Type boolean of variable that.plotArea does not match with type org.jfree.ui.VerticalAlignment of variable that.verticalAlignment
    • Make classes org.jfree.chart.renderer.xy.XYStepAreaRenderer and org.jfree.chart.title.Title extend a common superclass
    Expression that.plotArea cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.verticalAlignment 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 org.jfree.ui.VerticalAlignment of variable that.verticalAlignment
    12
    if (this.verticalAlignment != that.verticalAlignment)
    13
    return false;
    13
    return false;
    Precondition Violations (22)
    Row Violation
    1Type org.jfree.chart.renderer.xy.XYStepAreaRenderer does not match with type org.jfree.chart.title.Title
    2Unmatched return false;
    3Type boolean of variable that.showOutline does not match with type boolean of variable that.notify
    4Expression that.showOutline cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression that.notify cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Type boolean of variable this.shapesVisible does not match with type org.jfree.ui.RectangleEdge of variable this.position
    7Type boolean of variable that.shapesVisible does not match with type org.jfree.ui.RectangleEdge of variable that.position
    8Expression that.shapesVisible cannot be parameterized, because it has dependencies to/from statements that will be extracted
    9Expression that.position cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10Type boolean of variable that.shapesVisible does not match with type org.jfree.ui.RectangleEdge of variable that.position
    11Type boolean of variable this.shapesFilled does not match with type org.jfree.ui.HorizontalAlignment of variable this.horizontalAlignment
    12Type boolean of variable that.shapesFilled does not match with type org.jfree.ui.HorizontalAlignment of variable that.horizontalAlignment
    13Expression that.shapesFilled cannot be parameterized, because it has dependencies to/from statements that will be extracted
    14Expression that.horizontalAlignment cannot be parameterized, because it has dependencies to/from statements that will be extracted
    15Type boolean of variable that.shapesFilled does not match with type org.jfree.ui.HorizontalAlignment of variable that.horizontalAlignment
    16Type boolean of variable this.plotArea does not match with type org.jfree.ui.VerticalAlignment of variable this.verticalAlignment
    17Type boolean of variable that.plotArea does not match with type org.jfree.ui.VerticalAlignment of variable that.verticalAlignment
    18Expression that.plotArea cannot be parameterized, because it has dependencies to/from statements that will be extracted
    19Expression that.verticalAlignment cannot be parameterized, because it has dependencies to/from statements that will be extracted
    20Type boolean of variable that.plotArea does not match with type org.jfree.ui.VerticalAlignment of variable that.verticalAlignment
    21Not all possible execution flows end in a return statement
    22The refactoring of the clones is infeasible, because classes org.jfree.chart.renderer.xy.XYStepAreaRenderer and org.jfree.chart.title.Title do not have a common superclass