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;
if (obj == this) { return true; } if (!(obj instanceof XYInterval)) { return false; } XYInterval that = (XYInterval) obj; if (this.xLow != that.xLow) { return false; } if (this.xHigh != that.xHigh) { return false; } if (this.y != that.y) { return false; } if (this.yLow != that.yLow) { return false; } if (this.yHigh != that.yHigh) { return false; } return true;
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/title/Title.java File path: /jfreechart-1.0.10/src/org/jfree/data/xy/XYInterval.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 Title)) {
4
        if (!(obj instanceof XYInterval)) {
5
            return false;
5
            return false;
6
        }
6
        }
7
        if (!super.equals(obj)
7
        XYInterval that = (XYInterval) obj;
8
) {
8
        if (this.xLow != that.xLow) {
9
            return false;   
9
            return false;
10
        }
10
        }
11
        Title that = (Title) obj;
12
        if (this.position != that.position) {
11
        if (this.xHigh != that.xHigh) {
13
            return false;
12
            return false;
14
        }
13
        }
15
        if (this.horizontalAlignment != that.horizontalAlignment) {
14
        if (this.y != that.y) {
16
            return false;
15
            return false;
17
        }
16
        }
18
        if (this.verticalAlignment != that.verticalAlignment) {
17
        if (this.yLow != that.yLow) {
19
            return false;
18
            return false;
20
        }
19
        }
21
        if (this.notify != that.notify) {
20
        if (this.yHigh != that.yHigh) {
22
            return false;
21
            return false;
23
        }
22
        }
24
        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)3.6
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 fragment3
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)3.9
    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 Title))
    3
    if (!(obj instanceof Title))
    3
    if (!(obj instanceof XYInterval))
    Differences
    Expression1Expression2Difference
    org.jfree.chart.title.Titleorg.jfree.data.xy.XYIntervalVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jfree.chart.title.Title does not match with type org.jfree.data.xy.XYInterval
    • Make classes org.jfree.chart.title.Title and org.jfree.data.xy.XYInterval extend a common superclass
    3
    if (!(obj instanceof XYInterval))
    4
    return false;
    4
    return false;
                                                                          
    5
    XYInterval that = (XYInterval)obj;
    5
    if (!super.equals(obj))
                                                      
    6
    return false;
    6
    return false;
    Preondition Violations
    Unmatched return false;
                                    
    7
    Title that = (Title)obj;
                                                      
    8
    if (this.position != that.position)
    8
    if (this.position != that.position)
    8
    if (this.xHigh != that.xHigh)
    Differences
    Expression1Expression2Difference
    positionxHighVARIABLE_NAME_MISMATCH
    org.jfree.ui.RectangleEdgedoubleVARIABLE_TYPE_MISMATCH
    org.jfree.chart.title.Titleorg.jfree.data.xy.XYIntervalVARIABLE_TYPE_MISMATCH
    positionxHighVARIABLE_NAME_MISMATCH
    org.jfree.ui.RectangleEdgedoubleVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jfree.ui.RectangleEdge of variable this.position does not match with type double of variable this.xHigh
    Type org.jfree.ui.RectangleEdge of variable that.position does not match with type double of variable that.xHigh
    • Make classes org.jfree.chart.title.Title and org.jfree.data.xy.XYInterval extend a common superclass
    Expression that.position cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.xHigh cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type org.jfree.ui.RectangleEdge of variable that.position does not match with type double of variable that.xHigh
    8
    if (this.xHigh != that.xHigh)
    9
    return false;
    9
    return false;
    10
    if (this.horizontalAlignment != that.horizontalAlignment)
    10
    if (this.horizontalAlignment != that.horizontalAlignment)
    10
    if (this.y != that.y)
    Differences
    Expression1Expression2Difference
    horizontalAlignmentyVARIABLE_NAME_MISMATCH
    org.jfree.ui.HorizontalAlignmentdoubleVARIABLE_TYPE_MISMATCH
    org.jfree.chart.title.Titleorg.jfree.data.xy.XYIntervalVARIABLE_TYPE_MISMATCH
    horizontalAlignmentyVARIABLE_NAME_MISMATCH
    org.jfree.ui.HorizontalAlignmentdoubleVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jfree.ui.HorizontalAlignment of variable this.horizontalAlignment does not match with type double of variable this.y
    Type org.jfree.ui.HorizontalAlignment of variable that.horizontalAlignment does not match with type double of variable that.y
    • Make classes org.jfree.chart.title.Title and org.jfree.data.xy.XYInterval extend a common superclass
    Expression that.horizontalAlignment cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.y cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type org.jfree.ui.HorizontalAlignment of variable that.horizontalAlignment does not match with type double of variable that.y
    10
    if (this.y != that.y)
    11
    return false;
    11
    return false;
    12
    if (this.verticalAlignment != that.verticalAlignment)
    12
    if (this.verticalAlignment != that.verticalAlignment)
    12
    if (this.yLow != that.yLow)
    Differences
    Expression1Expression2Difference
    verticalAlignmentyLowVARIABLE_NAME_MISMATCH
    org.jfree.ui.VerticalAlignmentdoubleVARIABLE_TYPE_MISMATCH
    org.jfree.chart.title.Titleorg.jfree.data.xy.XYIntervalVARIABLE_TYPE_MISMATCH
    verticalAlignmentyLowVARIABLE_NAME_MISMATCH
    org.jfree.ui.VerticalAlignmentdoubleVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jfree.ui.VerticalAlignment of variable this.verticalAlignment does not match with type double of variable this.yLow
    Type org.jfree.ui.VerticalAlignment of variable that.verticalAlignment does not match with type double of variable that.yLow
    • Make classes org.jfree.chart.title.Title and org.jfree.data.xy.XYInterval extend a common superclass
    Expression that.verticalAlignment cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.yLow cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type org.jfree.ui.VerticalAlignment of variable that.verticalAlignment does not match with type double of variable that.yLow
    12
    if (this.yLow != that.yLow)
    13
    return false;
    13
    return false;
    14
    if (this.notify != that.notify)
    14
    if (this.notify != that.notify)
    6
    if (this.xLow != that.xLow)
    Differences
    Expression1Expression2Difference
    notifyxLowVARIABLE_NAME_MISMATCH
    booleandoubleVARIABLE_TYPE_MISMATCH
    org.jfree.chart.title.Titleorg.jfree.data.xy.XYIntervalVARIABLE_TYPE_MISMATCH
    notifyxLowVARIABLE_NAME_MISMATCH
    booleandoubleVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type boolean of variable this.notify does not match with type double of variable this.xLow
    Type boolean of variable that.notify does not match with type double of variable that.xLow
    • Make classes org.jfree.chart.title.Title and org.jfree.data.xy.XYInterval extend a common superclass
    Expression that.notify cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.xLow cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type boolean of variable that.notify does not match with type double of variable that.xLow
    6
    if (this.xLow != that.xLow)
    15
    return false;
    7
    return false;
    Precondition Violations (24)
    Row Violation
    1Type org.jfree.chart.title.Title does not match with type org.jfree.data.xy.XYInterval
    2Unmatched return false;
    3Type org.jfree.ui.RectangleEdge of variable this.position does not match with type double of variable this.xHigh
    4Type org.jfree.ui.RectangleEdge of variable that.position does not match with type double of variable that.xHigh
    5Expression that.position cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression that.xHigh cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Type org.jfree.ui.RectangleEdge of variable that.position does not match with type double of variable that.xHigh
    8Type org.jfree.ui.HorizontalAlignment of variable this.horizontalAlignment does not match with type double of variable this.y
    9Type org.jfree.ui.HorizontalAlignment of variable that.horizontalAlignment does not match with type double of variable that.y
    10Expression that.horizontalAlignment cannot be parameterized, because it has dependencies to/from statements that will be extracted
    11Expression that.y cannot be parameterized, because it has dependencies to/from statements that will be extracted
    12Type org.jfree.ui.HorizontalAlignment of variable that.horizontalAlignment does not match with type double of variable that.y
    13Type org.jfree.ui.VerticalAlignment of variable this.verticalAlignment does not match with type double of variable this.yLow
    14Type org.jfree.ui.VerticalAlignment of variable that.verticalAlignment does not match with type double of variable that.yLow
    15Expression that.verticalAlignment cannot be parameterized, because it has dependencies to/from statements that will be extracted
    16Expression that.yLow cannot be parameterized, because it has dependencies to/from statements that will be extracted
    17Type org.jfree.ui.VerticalAlignment of variable that.verticalAlignment does not match with type double of variable that.yLow
    18Type boolean of variable this.notify does not match with type double of variable this.xLow
    19Type boolean of variable that.notify does not match with type double of variable that.xLow
    20Expression that.notify cannot be parameterized, because it has dependencies to/from statements that will be extracted
    21Expression that.xLow cannot be parameterized, because it has dependencies to/from statements that will be extracted
    22Type boolean of variable that.notify does not match with type double of variable that.xLow
    23Not all possible execution flows end in a return statement
    24The refactoring of the clones is infeasible, because classes org.jfree.chart.title.Title and org.jfree.data.xy.XYInterval do not have a common superclass