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 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/title/Title.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 Title)) {
4
        if (!(obj instanceof Millisecond)) {
5
            return false;
5
            return false;
6
        }
6
        }
7
        if (!super.equals(obj)
7
        Millisecond that = (Millisecond) obj;
8
) {
8
        if (this.millisecond != that.millisecond) {
9
            return false;   
9
            return false;
10
        }
10
        }
11
        Title that = (Title) obj;
12
        if (this.position != that.position) {
11
        if (this.second != that.second) {
13
            return false;
12
            return false;
14
        }
13
        }
15
        if (this.horizontalAlignment != that.horizontalAlignment) {
14
        if (this.minute != that.minute) {
16
            return false;
15
            return false;
17
        }
16
        }
18
        if (this.verticalAlignment != that.verticalAlignment) {
17
        if (this.hour != that.hour) {
19
            return false;
18
            return false;
20
        }
19
        }
21
        if (this.notify != that.notify) {
20
        if (!this.day.equals(that.day)) {
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)4.4
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)9.6
    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 Title))
    3
    if (!(obj instanceof Title))
    3
    if (!(obj instanceof Millisecond))
    Differences
    Expression1Expression2Difference
    org.jfree.chart.title.Titleorg.jfree.data.time.MillisecondVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jfree.chart.title.Title does not match with type org.jfree.data.time.Millisecond
    • Make classes org.jfree.chart.title.Title 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
    if (!super.equals(obj))
    5
    if (!super.equals(obj))
    14
    if (!this.day.equals(that.day))
    Differences
    Expression1Expression2Difference
    super.equals(obj)this.day.equals(that.day)TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression this.day.equals(that.day) 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
    14
    if (!this.day.equals(that.day))
    6
    return false;
    15
    return false;
    7
    Title that = (Title)obj;
                                                      
    8
    if (this.position != that.position)
    8
    if (this.position != that.position)
    8
    if (this.second != that.second)
    Differences
    Expression1Expression2Difference
    positionsecondVARIABLE_NAME_MISMATCH
    org.jfree.ui.RectangleEdgebyteVARIABLE_TYPE_MISMATCH
    org.jfree.chart.title.Titleorg.jfree.data.time.MillisecondVARIABLE_TYPE_MISMATCH
    positionsecondVARIABLE_NAME_MISMATCH
    org.jfree.ui.RectangleEdgebyteVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jfree.ui.RectangleEdge of variable this.position does not match with type byte of variable this.second
    Type org.jfree.ui.RectangleEdge of variable that.position does not match with type byte of variable that.second
    • Make classes org.jfree.chart.title.Title and org.jfree.data.time.Millisecond extend a common superclass
    Expression that.position 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 org.jfree.ui.RectangleEdge of variable that.position 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.horizontalAlignment != that.horizontalAlignment)
    10
    if (this.horizontalAlignment != that.horizontalAlignment)
    10
    if (this.minute != that.minute)
    Differences
    Expression1Expression2Difference
    horizontalAlignmentminuteVARIABLE_NAME_MISMATCH
    org.jfree.ui.HorizontalAlignmentbyteVARIABLE_TYPE_MISMATCH
    org.jfree.chart.title.Titleorg.jfree.data.time.MillisecondVARIABLE_TYPE_MISMATCH
    horizontalAlignmentminuteVARIABLE_NAME_MISMATCH
    org.jfree.ui.HorizontalAlignmentbyteVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jfree.ui.HorizontalAlignment of variable this.horizontalAlignment does not match with type byte of variable this.minute
    Type org.jfree.ui.HorizontalAlignment of variable that.horizontalAlignment does not match with type byte of variable that.minute
    • Make classes org.jfree.chart.title.Title and org.jfree.data.time.Millisecond extend a common superclass
    Expression that.horizontalAlignment 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 org.jfree.ui.HorizontalAlignment of variable that.horizontalAlignment 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.verticalAlignment != that.verticalAlignment)
    12
    if (this.verticalAlignment != that.verticalAlignment)
    12
    if (this.hour != that.hour)
    Differences
    Expression1Expression2Difference
    verticalAlignmenthourVARIABLE_NAME_MISMATCH
    org.jfree.ui.VerticalAlignmentbyteVARIABLE_TYPE_MISMATCH
    org.jfree.chart.title.Titleorg.jfree.data.time.MillisecondVARIABLE_TYPE_MISMATCH
    verticalAlignmenthourVARIABLE_NAME_MISMATCH
    org.jfree.ui.VerticalAlignmentbyteVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jfree.ui.VerticalAlignment of variable this.verticalAlignment does not match with type byte of variable this.hour
    Type org.jfree.ui.VerticalAlignment of variable that.verticalAlignment does not match with type byte of variable that.hour
    • Make classes org.jfree.chart.title.Title and org.jfree.data.time.Millisecond extend a common superclass
    Expression that.verticalAlignment 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 org.jfree.ui.VerticalAlignment of variable that.verticalAlignment does not match with type byte of variable that.hour
    12
    if (this.hour != that.hour)
    13
    return false;
    13
    return false;
    14
    if (this.notify != that.notify)
    14
    if (this.notify != that.notify)
    6
    if (this.millisecond != that.millisecond)
    Differences
    Expression1Expression2Difference
    notifymillisecondVARIABLE_NAME_MISMATCH
    booleanintVARIABLE_TYPE_MISMATCH
    org.jfree.chart.title.Titleorg.jfree.data.time.MillisecondVARIABLE_TYPE_MISMATCH
    notifymillisecondVARIABLE_NAME_MISMATCH
    booleanintVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type boolean of variable this.notify does not match with type int of variable this.millisecond
    Type boolean of variable that.notify does not match with type int of variable that.millisecond
    • Make classes org.jfree.chart.title.Title and org.jfree.data.time.Millisecond extend a common superclass
    Expression that.notify 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.notify does not match with type int of variable that.millisecond
    6
    if (this.millisecond != that.millisecond)
    15
    return false;
    7
    return false;
    16
    return true;
    16
    return true;
    Precondition Violations (24)
    Row Violation
    1Type org.jfree.chart.title.Title does not match with type org.jfree.data.time.Millisecond
    2Expression this.day.equals(that.day) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Super method call if(!super.equals(obj)) cannot be extracted from method
    4Type org.jfree.ui.RectangleEdge of variable this.position does not match with type byte of variable this.second
    5Type org.jfree.ui.RectangleEdge of variable that.position does not match with type byte of variable that.second
    6Expression that.position cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression that.second cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Type org.jfree.ui.RectangleEdge of variable that.position does not match with type byte of variable that.second
    9Type org.jfree.ui.HorizontalAlignment of variable this.horizontalAlignment does not match with type byte of variable this.minute
    10Type org.jfree.ui.HorizontalAlignment of variable that.horizontalAlignment does not match with type byte of variable that.minute
    11Expression that.horizontalAlignment cannot be parameterized, because it has dependencies to/from statements that will be extracted
    12Expression that.minute cannot be parameterized, because it has dependencies to/from statements that will be extracted
    13Type org.jfree.ui.HorizontalAlignment of variable that.horizontalAlignment does not match with type byte of variable that.minute
    14Type org.jfree.ui.VerticalAlignment of variable this.verticalAlignment does not match with type byte of variable this.hour
    15Type org.jfree.ui.VerticalAlignment of variable that.verticalAlignment does not match with type byte of variable that.hour
    16Expression that.verticalAlignment cannot be parameterized, because it has dependencies to/from statements that will be extracted
    17Expression that.hour cannot be parameterized, because it has dependencies to/from statements that will be extracted
    18Type org.jfree.ui.VerticalAlignment of variable that.verticalAlignment does not match with type byte of variable that.hour
    19Type boolean of variable this.notify does not match with type int of variable this.millisecond
    20Type boolean of variable that.notify does not match with type int of variable that.millisecond
    21Expression that.notify cannot be parameterized, because it has dependencies to/from statements that will be extracted
    22Expression that.millisecond cannot be parameterized, because it has dependencies to/from statements that will be extracted
    23Type boolean of variable that.notify does not match with type int of variable that.millisecond
    24The refactoring of the clones is infeasible, because classes org.jfree.chart.title.Title and org.jfree.data.time.Millisecond do not have a common superclass