if (obj == this) { return true; } if (!(obj instanceof BoxAndWhiskerRenderer)) { return false; } if (!super.equals(obj)) { return false; } BoxAndWhiskerRenderer that = (BoxAndWhiskerRenderer) obj; if (!PaintUtilities.equal(this.artifactPaint, that.artifactPaint)) { return false; } if (this.fillBox != that.fillBox) { return false; } if (this.itemMargin != that.itemMargin) { return false; } if (this.maximumBarWidth != that.maximumBarWidth) { 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/renderer/category/BoxAndWhiskerRenderer.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 BoxAndWhiskerRenderer)) {
4
        if (!(obj instanceof Millisecond)) {
5
            return false;
5
            return false;
6
        }
6
        }
7
        if (!super.equals(obj)) {
7
        
8
            return false;
9
        }
10
        BoxAndWhiskerRenderer that = (BoxAndWhiskerRenderer) obj;
11
        if (!PaintUtilities.equal(this.artifactPaint, that.artifactPaint)
8
Millisecond that = (Millisecond) obj;
9
        if (this.millisecond != that.millisecond) {
10
            return false;
11
        }
12
) {
12
        if (this.second != that.second) {
13
            return false;
13
            return false;
14
        }
14
        }
15
        if (this.fillBox != that.fillBox) {
15
        if (this.minute != that.minute) {
16
            return false;
16
            return false;
17
        }
17
        }
18
        if (this.itemMargin != that.itemMargin) {
18
        if (this.hour != that.hour) {
19
            return false;
19
            return false;
20
        }
20
        }
21
        if (this.maximumBarWidth != that.maximumBarWidth) {
21
        if (!this.day.equals(that.day)) {
22
            return false;
22
            return false;
23
        }
23
        }
24
        return true;
24
        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.1
Clones locationClones are in different classes
Number of node comparisons89
  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 fragment3
    Time elapsed for statement mapping (ms)9.8
    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 BoxAndWhiskerRenderer))
    3
    if (!(obj instanceof BoxAndWhiskerRenderer))
    3
    if (!(obj instanceof Millisecond))
    Differences
    Expression1Expression2Difference
    org.jfree.chart.renderer.category.BoxAndWhiskerRendererorg.jfree.data.time.MillisecondVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jfree.chart.renderer.category.BoxAndWhiskerRenderer does not match with type org.jfree.data.time.Millisecond
    • Make classes org.jfree.chart.renderer.category.BoxAndWhiskerRenderer 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;
                                                                                          
    6
    if (this.millisecond != that.millisecond)
                                    
    7
    return false;
    Preondition Violations
    Unmatched return false;
    7
    return false;
    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
    BoxAndWhiskerRenderer that = (BoxAndWhiskerRenderer)obj;
                                                                                                                      
    8
    if (!PaintUtilities.equal(this.artifactPaint, that.artifactPaint))
                                                                                                                                          
    9
    return false;
    9
    return false;
    Preondition Violations
    Unmatched return false;
                                    
    10
    if (this.fillBox != that.fillBox)
    10
    if (this.fillBox != that.fillBox)
    10
    if (this.minute != that.minute)
    Differences
    Expression1Expression2Difference
    fillBoxminuteVARIABLE_NAME_MISMATCH
    booleanbyteVARIABLE_TYPE_MISMATCH
    org.jfree.chart.renderer.category.BoxAndWhiskerRendererorg.jfree.data.time.MillisecondVARIABLE_TYPE_MISMATCH
    fillBoxminuteVARIABLE_NAME_MISMATCH
    booleanbyteVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type boolean of variable this.fillBox does not match with type byte of variable this.minute
    Type boolean of variable that.fillBox does not match with type byte of variable that.minute
    • Make classes org.jfree.chart.renderer.category.BoxAndWhiskerRenderer and org.jfree.data.time.Millisecond extend a common superclass
    Expression that.fillBox 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 boolean of variable that.fillBox 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.itemMargin != that.itemMargin)
    12
    if (this.itemMargin != that.itemMargin)
    12
    if (this.hour != that.hour)
    Differences
    Expression1Expression2Difference
    itemMarginhourVARIABLE_NAME_MISMATCH
    doublebyteVARIABLE_TYPE_MISMATCH
    org.jfree.chart.renderer.category.BoxAndWhiskerRendererorg.jfree.data.time.MillisecondVARIABLE_TYPE_MISMATCH
    itemMarginhourVARIABLE_NAME_MISMATCH
    doublebyteVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type double of variable this.itemMargin does not match with type byte of variable this.hour
    Type double of variable that.itemMargin does not match with type byte of variable that.hour
    • Make classes org.jfree.chart.renderer.category.BoxAndWhiskerRenderer and org.jfree.data.time.Millisecond extend a common superclass
    Expression that.itemMargin 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.itemMargin 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.maximumBarWidth != that.maximumBarWidth)
    14
    if (this.maximumBarWidth != that.maximumBarWidth)
    8
    if (this.second != that.second)
    Differences
    Expression1Expression2Difference
    maximumBarWidthsecondVARIABLE_NAME_MISMATCH
    doublebyteVARIABLE_TYPE_MISMATCH
    org.jfree.chart.renderer.category.BoxAndWhiskerRendererorg.jfree.data.time.MillisecondVARIABLE_TYPE_MISMATCH
    maximumBarWidthsecondVARIABLE_NAME_MISMATCH
    doublebyteVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type double of variable this.maximumBarWidth does not match with type byte of variable this.second
    Type double of variable that.maximumBarWidth does not match with type byte of variable that.second
    • Make classes org.jfree.chart.renderer.category.BoxAndWhiskerRenderer and org.jfree.data.time.Millisecond extend a common superclass
    Expression that.maximumBarWidth 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.maximumBarWidth does not match with type byte of variable that.second
    8
    if (this.second != that.second)
    15
    return false;
    9
    return false;
    Precondition Violations (22)
    Row Violation
    1Type org.jfree.chart.renderer.category.BoxAndWhiskerRenderer does not match with type org.jfree.data.time.Millisecond
    2Unmatched return false;
    3Expression this.day.equals(that.day) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Super method call if(!super.equals(obj)) cannot be extracted from method
    5Unmatched return false;
    6Type boolean of variable this.fillBox does not match with type byte of variable this.minute
    7Type boolean of variable that.fillBox does not match with type byte of variable that.minute
    8Expression that.fillBox cannot be parameterized, because it has dependencies to/from statements that will be extracted
    9Expression that.minute cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10Type boolean of variable that.fillBox does not match with type byte of variable that.minute
    11Type double of variable this.itemMargin does not match with type byte of variable this.hour
    12Type double of variable that.itemMargin does not match with type byte of variable that.hour
    13Expression that.itemMargin cannot be parameterized, because it has dependencies to/from statements that will be extracted
    14Expression that.hour cannot be parameterized, because it has dependencies to/from statements that will be extracted
    15Type double of variable that.itemMargin does not match with type byte of variable that.hour
    16Type double of variable this.maximumBarWidth does not match with type byte of variable this.second
    17Type double of variable that.maximumBarWidth does not match with type byte of variable that.second
    18Expression that.maximumBarWidth cannot be parameterized, because it has dependencies to/from statements that will be extracted
    19Expression that.second cannot be parameterized, because it has dependencies to/from statements that will be extracted
    20Type double of variable that.maximumBarWidth does not match with type byte of variable that.second
    21Not all possible execution flows end in a return statement
    22The refactoring of the clones is infeasible, because classes org.jfree.chart.renderer.category.BoxAndWhiskerRenderer and org.jfree.data.time.Millisecond do not have a common superclass