if (obj == this) { return true; } if (!(obj instanceof XYErrorRenderer)) { return false; } XYErrorRenderer that = (XYErrorRenderer) obj; if (this.drawXError != that.drawXError) { return false; } if (this.drawYError != that.drawYError) { return false; } if (this.capLength != that.capLength) { return false; } if (!PaintUtilities.equal(this.errorPaint, that.errorPaint)) { 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/XYErrorRenderer.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: 14 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 XYErrorRenderer)) {
4
        if (!(obj instanceof Title)) {
5
            return false;
5
            return false;
6
        }
6
        }
7
        XYErrorRenderer that = (XYErrorRenderer
7
        if (!super.equals(obj)) {
8
            return false;   
9
        }
8
) obj;
10
        Title that = (Title) obj;
9
        if (this.drawXError != that.drawXError) {
11
        if (this.position != that.position) {
10
            return false;
12
            return false;
11
        }
13
        }
12
        if (this.drawYError != that.drawYError) {
14
        if (this.horizontalAlignment != that.horizontalAlignment) {
13
            return false;
15
            return false;
14
        }
16
        }
15
        if (this.capLength != that.capLength) {
17
        if (this.verticalAlignment != that.verticalAlignment) {
16
            return false;
18
            return false;
17
        }
19
        }
18
        if (!PaintUtilities.equal(this.errorPaint, that.errorPaint)) {
20
        if (this.notify != that.notify) {
19
            return false;
21
            return false;
20
        }
22
        }
21
        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)4.2
Clones locationClones are in different classes
Number of node comparisons76
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements13
    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 XYErrorRenderer))
    3
    if (!(obj instanceof XYErrorRenderer))
    3
    if (!(obj instanceof Title))
    Differences
    Expression1Expression2Difference
    org.jfree.chart.renderer.xy.XYErrorRendererorg.jfree.chart.title.TitleVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jfree.chart.renderer.xy.XYErrorRenderer does not match with type org.jfree.chart.title.Title
    • Make classes org.jfree.chart.renderer.xy.XYErrorRenderer and org.jfree.chart.title.Title extend a common superclass
    3
    if (!(obj instanceof Title))
    4
    return false;
    4
    return false;
    5
    XYErrorRenderer that = (XYErrorRenderer)obj;
                                                                                              
                                                      
    7
    Title that = (Title)obj;
    6
    if (this.drawXError != that.drawXError)
    6
    if (this.drawXError != that.drawXError)
    8
    if (this.position != that.position)
    Differences
    Expression1Expression2Difference
    drawXErrorpositionVARIABLE_NAME_MISMATCH
    booleanorg.jfree.ui.RectangleEdgeVARIABLE_TYPE_MISMATCH
    org.jfree.chart.renderer.xy.XYErrorRendererorg.jfree.chart.title.TitleVARIABLE_TYPE_MISMATCH
    drawXErrorpositionVARIABLE_NAME_MISMATCH
    booleanorg.jfree.ui.RectangleEdgeVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type boolean of variable this.drawXError does not match with type org.jfree.ui.RectangleEdge of variable this.position
    Type boolean of variable that.drawXError does not match with type org.jfree.ui.RectangleEdge of variable that.position
    • Make classes org.jfree.chart.renderer.xy.XYErrorRenderer and org.jfree.chart.title.Title extend a common superclass
    Expression that.drawXError 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.drawXError does not match with type org.jfree.ui.RectangleEdge of variable that.position
    8
    if (this.position != that.position)
    7
    return false;
    9
    return false;
    8
    if (this.drawYError != that.drawYError)
    8
    if (this.drawYError != that.drawYError)
    10
    if (this.horizontalAlignment != that.horizontalAlignment)
    Differences
    Expression1Expression2Difference
    drawYErrorhorizontalAlignmentVARIABLE_NAME_MISMATCH
    booleanorg.jfree.ui.HorizontalAlignmentVARIABLE_TYPE_MISMATCH
    org.jfree.chart.renderer.xy.XYErrorRendererorg.jfree.chart.title.TitleVARIABLE_TYPE_MISMATCH
    drawYErrorhorizontalAlignmentVARIABLE_NAME_MISMATCH
    booleanorg.jfree.ui.HorizontalAlignmentVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type boolean of variable this.drawYError does not match with type org.jfree.ui.HorizontalAlignment of variable this.horizontalAlignment
    Type boolean of variable that.drawYError does not match with type org.jfree.ui.HorizontalAlignment of variable that.horizontalAlignment
    • Make classes org.jfree.chart.renderer.xy.XYErrorRenderer and org.jfree.chart.title.Title extend a common superclass
    Expression that.drawYError 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.drawYError does not match with type org.jfree.ui.HorizontalAlignment of variable that.horizontalAlignment
    10
    if (this.horizontalAlignment != that.horizontalAlignment)
    9
    return false;
    11
    return false;
    10
    if (this.capLength != that.capLength)
    10
    if (this.capLength != that.capLength)
    12
    if (this.verticalAlignment != that.verticalAlignment)
    Differences
    Expression1Expression2Difference
    capLengthverticalAlignmentVARIABLE_NAME_MISMATCH
    doubleorg.jfree.ui.VerticalAlignmentVARIABLE_TYPE_MISMATCH
    org.jfree.chart.renderer.xy.XYErrorRendererorg.jfree.chart.title.TitleVARIABLE_TYPE_MISMATCH
    capLengthverticalAlignmentVARIABLE_NAME_MISMATCH
    doubleorg.jfree.ui.VerticalAlignmentVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type double of variable this.capLength does not match with type org.jfree.ui.VerticalAlignment of variable this.verticalAlignment
    Type double of variable that.capLength does not match with type org.jfree.ui.VerticalAlignment of variable that.verticalAlignment
    • Make classes org.jfree.chart.renderer.xy.XYErrorRenderer and org.jfree.chart.title.Title extend a common superclass
    Expression that.capLength 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 double of variable that.capLength does not match with type org.jfree.ui.VerticalAlignment of variable that.verticalAlignment
    12
    if (this.verticalAlignment != that.verticalAlignment)
    11
    return false;
    13
    return false;
    12
    if (!PaintUtilities.equal(this.errorPaint, that.errorPaint))
    12
    if (!PaintUtilities.equal(this.errorPaint, that.errorPaint))
    5
    if (!super.equals(obj))
    Differences
    Expression1Expression2Difference
    PaintUtilities.equal(this.errorPaint,that.errorPaint)super.equals(obj)TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression PaintUtilities.equal(this.errorPaint,that.errorPaint) 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))
    13
    return false;
    6
    return false;
    14
    return super.equals(obj);
    14
    return super.equals(obj);
    16
    return true;
    Differences
    Expression1Expression2Difference
    super.equals(obj)trueTYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Super method call return super.equals(obj); cannot be extracted from method
    16
    return true;
    Precondition Violations (21)
    Row Violation
    1Type org.jfree.chart.renderer.xy.XYErrorRenderer does not match with type org.jfree.chart.title.Title
    2Type boolean of variable this.drawXError does not match with type org.jfree.ui.RectangleEdge of variable this.position
    3Type boolean of variable that.drawXError does not match with type org.jfree.ui.RectangleEdge of variable that.position
    4Expression that.drawXError cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression that.position cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Type boolean of variable that.drawXError does not match with type org.jfree.ui.RectangleEdge of variable that.position
    7Type boolean of variable this.drawYError does not match with type org.jfree.ui.HorizontalAlignment of variable this.horizontalAlignment
    8Type boolean of variable that.drawYError does not match with type org.jfree.ui.HorizontalAlignment of variable that.horizontalAlignment
    9Expression that.drawYError cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10Expression that.horizontalAlignment cannot be parameterized, because it has dependencies to/from statements that will be extracted
    11Type boolean of variable that.drawYError does not match with type org.jfree.ui.HorizontalAlignment of variable that.horizontalAlignment
    12Type double of variable this.capLength does not match with type org.jfree.ui.VerticalAlignment of variable this.verticalAlignment
    13Type double of variable that.capLength does not match with type org.jfree.ui.VerticalAlignment of variable that.verticalAlignment
    14Expression that.capLength cannot be parameterized, because it has dependencies to/from statements that will be extracted
    15Expression that.verticalAlignment cannot be parameterized, because it has dependencies to/from statements that will be extracted
    16Type double of variable that.capLength does not match with type org.jfree.ui.VerticalAlignment of variable that.verticalAlignment
    17Expression PaintUtilities.equal(this.errorPaint,that.errorPaint) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    18Super method call if(!super.equals(obj)) cannot be extracted from method
    19Super method call return super.equals(obj); cannot be extracted from method
    20Not all possible execution flows end in a return statement
    21The refactoring of the clones is infeasible, because classes org.jfree.chart.renderer.xy.XYErrorRenderer and org.jfree.chart.title.Title do not have a common superclass