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;
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/data/time/Millisecond.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 Millisecond)) {
4
        if (!(obj instanceof XYInterval)) {
5
            return false;
5
            return false;
6
        }
6
        }
7
        Millisecond that = (Millisecond) obj;
7
        XYInterval that = (XYInterval) obj;
8
        if (this.millisecond != that.millisecond) {
8
        if (this.xLow != that.xLow) {
9
            return false;
9
            return false;
10
        }
10
        }
11
        if (this.second != that.second) {
11
        if (this.xHigh != that.xHigh) {
12
            return false;
12
            return false;
13
        }
13
        }
14
        if (this.minute != that.minute) {
14
        if (this.y != that.y) {
15
            return false;
15
            return false;
16
        }
16
        }
17
        if (this.hour != that.hour) {
17
        if (this.yLow != that.yLow) {
18
            return false;
18
            return false;
19
        }
19
        }
20
        if (!this.day.equals(that.day)) {
20
        if (this.yHigh != that.yHigh) {
21
            return false;
21
            return false;
22
        }
22
        }
23
        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.5
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 fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)3.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 Millisecond))
    3
    if (!(obj instanceof Millisecond))
    3
    if (!(obj instanceof XYInterval))
    Differences
    Expression1Expression2Difference
    org.jfree.data.time.Millisecondorg.jfree.data.xy.XYIntervalVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jfree.data.time.Millisecond does not match with type org.jfree.data.xy.XYInterval
    • Make classes org.jfree.data.time.Millisecond 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
    Millisecond that = (Millisecond)obj;
                                                                              
    6
    if (this.millisecond != that.millisecond)
    6
    if (this.millisecond != that.millisecond)
    6
    if (this.xLow != that.xLow)
    Differences
    Expression1Expression2Difference
    millisecondxLowVARIABLE_NAME_MISMATCH
    intdoubleVARIABLE_TYPE_MISMATCH
    org.jfree.data.time.Millisecondorg.jfree.data.xy.XYIntervalVARIABLE_TYPE_MISMATCH
    millisecondxLowVARIABLE_NAME_MISMATCH
    intdoubleVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type int of variable this.millisecond does not match with type double of variable this.xLow
    Type int of variable that.millisecond does not match with type double of variable that.xLow
    • Make classes org.jfree.data.time.Millisecond and org.jfree.data.xy.XYInterval extend a common superclass
    Expression that.millisecond 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 int of variable that.millisecond does not match with type double of variable that.xLow
    6
    if (this.xLow != that.xLow)
    7
    return false;
    7
    return false;
    8
    if (this.second != that.second)
    8
    if (this.second != that.second)
    8
    if (this.xHigh != that.xHigh)
    Differences
    Expression1Expression2Difference
    secondxHighVARIABLE_NAME_MISMATCH
    bytedoubleVARIABLE_TYPE_MISMATCH
    org.jfree.data.time.Millisecondorg.jfree.data.xy.XYIntervalVARIABLE_TYPE_MISMATCH
    secondxHighVARIABLE_NAME_MISMATCH
    bytedoubleVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type byte of variable this.second does not match with type double of variable this.xHigh
    Type byte of variable that.second does not match with type double of variable that.xHigh
    • Make classes org.jfree.data.time.Millisecond and org.jfree.data.xy.XYInterval extend a common superclass
    Expression that.second 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 byte of variable that.second 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.minute != that.minute)
    10
    if (this.minute != that.minute)
    10
    if (this.y != that.y)
    Differences
    Expression1Expression2Difference
    minuteyVARIABLE_NAME_MISMATCH
    bytedoubleVARIABLE_TYPE_MISMATCH
    org.jfree.data.time.Millisecondorg.jfree.data.xy.XYIntervalVARIABLE_TYPE_MISMATCH
    minuteyVARIABLE_NAME_MISMATCH
    bytedoubleVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type byte of variable this.minute does not match with type double of variable this.y
    Type byte of variable that.minute does not match with type double of variable that.y
    • Make classes org.jfree.data.time.Millisecond and org.jfree.data.xy.XYInterval extend a common superclass
    Expression that.minute 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 byte of variable that.minute 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.hour != that.hour)
    12
    if (this.hour != that.hour)
    12
    if (this.yLow != that.yLow)
    Differences
    Expression1Expression2Difference
    houryLowVARIABLE_NAME_MISMATCH
    bytedoubleVARIABLE_TYPE_MISMATCH
    org.jfree.data.time.Millisecondorg.jfree.data.xy.XYIntervalVARIABLE_TYPE_MISMATCH
    houryLowVARIABLE_NAME_MISMATCH
    bytedoubleVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type byte of variable this.hour does not match with type double of variable this.yLow
    Type byte of variable that.hour does not match with type double of variable that.yLow
    • Make classes org.jfree.data.time.Millisecond and org.jfree.data.xy.XYInterval extend a common superclass
    Expression that.hour 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 byte of variable that.hour does not match with type double of variable that.yLow
    12
    if (this.yLow != that.yLow)
    13
    return false;
    13
    return false;
    Precondition Violations (23)
    Row Violation
    1Type org.jfree.data.time.Millisecond does not match with type org.jfree.data.xy.XYInterval
    2Type int of variable this.millisecond does not match with type double of variable this.xLow
    3Type int of variable that.millisecond does not match with type double of variable that.xLow
    4Expression that.millisecond cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression that.xLow cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Type int of variable that.millisecond does not match with type double of variable that.xLow
    7Type byte of variable this.second does not match with type double of variable this.xHigh
    8Type byte of variable that.second does not match with type double of variable that.xHigh
    9Expression that.second cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10Expression that.xHigh cannot be parameterized, because it has dependencies to/from statements that will be extracted
    11Type byte of variable that.second does not match with type double of variable that.xHigh
    12Type byte of variable this.minute does not match with type double of variable this.y
    13Type byte of variable that.minute does not match with type double of variable that.y
    14Expression that.minute cannot be parameterized, because it has dependencies to/from statements that will be extracted
    15Expression that.y cannot be parameterized, because it has dependencies to/from statements that will be extracted
    16Type byte of variable that.minute does not match with type double of variable that.y
    17Type byte of variable this.hour does not match with type double of variable this.yLow
    18Type byte of variable that.hour does not match with type double of variable that.yLow
    19Expression that.hour cannot be parameterized, because it has dependencies to/from statements that will be extracted
    20Expression that.yLow cannot be parameterized, because it has dependencies to/from statements that will be extracted
    21Type byte of variable that.hour does not match with type double of variable that.yLow
    22Not all possible execution flows end in a return statement
    23The refactoring of the clones is infeasible, because classes org.jfree.data.time.Millisecond and org.jfree.data.xy.XYInterval do not have a common superclass