if (obj == this) { return true; } if (!(obj instanceof AxisSpace)) { return false; } AxisSpace that = (AxisSpace) obj; if (this.top != that.top) { return false; } if (this.bottom != that.bottom) { return false; } if (this.left != that.left) { return false; } if (this.right != that.right) { return false; } return true;
if (obj == this) { return true; } if (!(obj instanceof Second)) { return false; } Second that = (Second) obj; 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/axis/AxisSpace.java File path: /jfreechart-1.0.10/src/org/jfree/data/time/Second.java
Method name: boolean equals(Object) Method name: boolean equals(Object)
Number of AST nodes: 14 Number of AST nodes: 14
1
if (obj == this) {
1
if (obj == this) {
2
            return true;
2
            return true;
3
        }
3
        }
4
        if (!(obj instanceof AxisSpace)) {
4
        if (!(obj instanceof Second)) {
5
            return false;
5
            return false;
6
        }
6
        }
7
        AxisSpace that = (AxisSpace) obj;
7
        Second that = (Second) obj;
8
        if (this.top != that.top) {
8
        if (this.second != that.second) {
9
            return false;
9
            return false;
10
        }   
10
        }
11
        if (this.bottom != that.bottom) {
11
        if (this.minute != that.minute) {
12
            return false;
12
            return false;
13
        }
13
        }
14
        if (this.left != that.left) {
14
        if (this.hour != that.hour) {
15
            return false;
15
            return false;
16
        }
16
        }
17
        if (this.right != that.right) {
17
        if (!this.day.equals(that.day)) {
18
            return false;
18
            return false;
19
        }
19
        }
20
        return true;
20
        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)2.8
Clones locationClones are in different classes
Number of node comparisons61
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements10
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)2.7
    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 AxisSpace))
    3
    if (!(obj instanceof AxisSpace))
    3
    if (!(obj instanceof Second))
    Differences
    Expression1Expression2Difference
    org.jfree.chart.axis.AxisSpaceorg.jfree.data.time.SecondVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jfree.chart.axis.AxisSpace does not match with type org.jfree.data.time.Second
    • Make classes org.jfree.chart.axis.AxisSpace and org.jfree.data.time.Second extend a common superclass
    3
    if (!(obj instanceof Second))
    4
    return false;
    4
    return false;
                                                          
    5
    Second that = (Second)obj;
    5
    AxisSpace that = (AxisSpace)obj;
                                                                      
    6
    if (this.top != that.top)
    6
    if (this.top != that.top)
    6
    if (this.second != that.second)
    Differences
    Expression1Expression2Difference
    topsecondVARIABLE_NAME_MISMATCH
    doublebyteVARIABLE_TYPE_MISMATCH
    org.jfree.chart.axis.AxisSpaceorg.jfree.data.time.SecondVARIABLE_TYPE_MISMATCH
    topsecondVARIABLE_NAME_MISMATCH
    doublebyteVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type double of variable this.top does not match with type byte of variable this.second
    Type double of variable that.top does not match with type byte of variable that.second
    • Make classes org.jfree.chart.axis.AxisSpace and org.jfree.data.time.Second extend a common superclass
    Expression that.top 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 double of variable that.top does not match with type byte of variable that.second
    6
    if (this.second != that.second)
    7
    return false;
    7
    return false;
    8
    if (this.bottom != that.bottom)
    8
    if (this.bottom != that.bottom)
    8
    if (this.minute != that.minute)
    Differences
    Expression1Expression2Difference
    bottomminuteVARIABLE_NAME_MISMATCH
    doublebyteVARIABLE_TYPE_MISMATCH
    org.jfree.chart.axis.AxisSpaceorg.jfree.data.time.SecondVARIABLE_TYPE_MISMATCH
    bottomminuteVARIABLE_NAME_MISMATCH
    doublebyteVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type double of variable this.bottom does not match with type byte of variable this.minute
    Type double of variable that.bottom does not match with type byte of variable that.minute
    • Make classes org.jfree.chart.axis.AxisSpace and org.jfree.data.time.Second extend a common superclass
    Expression that.bottom 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 double of variable that.bottom does not match with type byte of variable that.minute
    8
    if (this.minute != that.minute)
    9
    return false;
    9
    return false;
    10
    if (this.left != that.left)
    10
    if (this.left != that.left)
    10
    if (this.hour != that.hour)
    Differences
    Expression1Expression2Difference
    lefthourVARIABLE_NAME_MISMATCH
    doublebyteVARIABLE_TYPE_MISMATCH
    org.jfree.chart.axis.AxisSpaceorg.jfree.data.time.SecondVARIABLE_TYPE_MISMATCH
    lefthourVARIABLE_NAME_MISMATCH
    doublebyteVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type double of variable this.left does not match with type byte of variable this.hour
    Type double of variable that.left does not match with type byte of variable that.hour
    • Make classes org.jfree.chart.axis.AxisSpace and org.jfree.data.time.Second extend a common superclass
    Expression that.left 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 double of variable that.left does not match with type byte of variable that.hour
    10
    if (this.hour != that.hour)
    11
    return false;
    11
    return false;
    Precondition Violations (18)
    Row Violation
    1Type org.jfree.chart.axis.AxisSpace does not match with type org.jfree.data.time.Second
    2Type double of variable this.top does not match with type byte of variable this.second
    3Type double of variable that.top does not match with type byte of variable that.second
    4Expression that.top cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression that.second cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Type double of variable that.top does not match with type byte of variable that.second
    7Type double of variable this.bottom does not match with type byte of variable this.minute
    8Type double of variable that.bottom does not match with type byte of variable that.minute
    9Expression that.bottom cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10Expression that.minute cannot be parameterized, because it has dependencies to/from statements that will be extracted
    11Type double of variable that.bottom does not match with type byte of variable that.minute
    12Type double of variable this.left does not match with type byte of variable this.hour
    13Type double of variable that.left does not match with type byte of variable that.hour
    14Expression that.left cannot be parameterized, because it has dependencies to/from statements that will be extracted
    15Expression that.hour cannot be parameterized, because it has dependencies to/from statements that will be extracted
    16Type double of variable that.left does not match with type byte of variable that.hour
    17Not all possible execution flows end in a return statement
    18The refactoring of the clones is infeasible, because classes org.jfree.chart.axis.AxisSpace and org.jfree.data.time.Second do not have a common superclass