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 GanttRenderer)) { return false; } GanttRenderer that = (GanttRenderer) obj; if (!PaintUtilities.equal(this.completePaint, that.completePaint)) { return false; } if (!PaintUtilities.equal(this.incompletePaint, that.incompletePaint)) { return false; } if (this.startPercent != that.startPercent) { return false; } if (this.endPercent != that.endPercent) { return false; } return super.equals(obj);
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/chart/renderer/category/GanttRenderer.java
Method name: boolean equals(Object) Method name: boolean equals(Object)
Number of AST nodes: 16 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 BoxAndWhiskerRenderer)) {
4
        if (!(obj instanceof GanttRenderer)) {
5
            return false;
5
            return false;
6
        }
6
        }
7
        if (!super.equals(obj)) {
7
        
8
            return false;
9
        }
10
        BoxAndWhiskerRenderer that = (BoxAndWhiskerRenderer) obj;
8
GanttRenderer that = (GanttRenderer) obj;
11
        if (!PaintUtilities.equal(this.artifactPaint, that.artifactPaint)) {
9
        if (!PaintUtilities.equal(this.completePaint, that.completePaint)) {
12
            return false;
10
            return false;
13
        }
11
        }
14
        if (this.fillBox != that.fillBox) {
12
        if (!PaintUtilities.equal(this.incompletePaint, that.incompletePaint)) {
15
            return false;
13
            return false;
16
        }
14
        }
17
        if (this.itemMargin != that.itemMargin) {
15
        if (this.startPercent != that.startPercent) {
18
            return false;
16
            return false;
19
        }
17
        }
20
        if (this.maximumBarWidth != that.maximumBarWidth) {
18
        if (this.endPercent != that.endPercent) {
21
            return false;
19
            return false;
22
        }
20
        }
23
        return true;
21
        return super.equals(obj);
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.8
Clones locationClones are in different classes having the same super class
Number of node comparisons76
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements13
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)5.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 BoxAndWhiskerRenderer))
    3
    if (!(obj instanceof BoxAndWhiskerRenderer))
    3
    if (!(obj instanceof GanttRenderer))
    Differences
    Expression1Expression2Difference
    org.jfree.chart.renderer.category.BoxAndWhiskerRendererorg.jfree.chart.renderer.category.GanttRendererSUBCLASS_TYPE_MISMATCH
    3
    if (!(obj instanceof GanttRenderer))
    4
    return false;
    4
    return false;
                                                                                      
    5
    GanttRenderer that = (GanttRenderer)obj;
    5
    if (!super.equals(obj))
    5
    if (!super.equals(obj))
    6
    if (!PaintUtilities.equal(this.completePaint, that.completePaint))
    Differences
    Expression1Expression2Difference
    super.equals(obj)PaintUtilities.equal(this.completePaint,that.completePaint)TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression PaintUtilities.equal(this.completePaint,that.completePaint) 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
    6
    if (!PaintUtilities.equal(this.completePaint, that.completePaint))
    6
    return false;
    7
    return false;
    7
    BoxAndWhiskerRenderer that = (BoxAndWhiskerRenderer)obj;
                                                                                                                      
    8
    if (!PaintUtilities.equal(this.artifactPaint, that.artifactPaint))
    8
    if (!PaintUtilities.equal(this.artifactPaint, that.artifactPaint))
    8
    if (!PaintUtilities.equal(this.incompletePaint, that.incompletePaint))
    Differences
    Expression1Expression2Difference
    artifactPaintincompletePaintVARIABLE_NAME_MISMATCH
    org.jfree.chart.renderer.category.BoxAndWhiskerRendererorg.jfree.chart.renderer.category.GanttRendererSUBCLASS_TYPE_MISMATCH
    artifactPaintincompletePaintVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression that.artifactPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.incompletePaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8
    if (!PaintUtilities.equal(this.incompletePaint, that.incompletePaint))
    9
    return false;
    9
    return false;
    10
    if (this.fillBox != that.fillBox)
    10
    if (this.fillBox != that.fillBox)
    10
    if (this.startPercent != that.startPercent)
    Differences
    Expression1Expression2Difference
    fillBoxstartPercentVARIABLE_NAME_MISMATCH
    booleandoubleVARIABLE_TYPE_MISMATCH
    org.jfree.chart.renderer.category.BoxAndWhiskerRendererorg.jfree.chart.renderer.category.GanttRendererSUBCLASS_TYPE_MISMATCH
    fillBoxstartPercentVARIABLE_NAME_MISMATCH
    booleandoubleVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type boolean of variable this.fillBox does not match with type double of variable this.startPercent
    Expression that.fillBox cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.startPercent 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 double of variable that.startPercent
    10
    if (this.startPercent != that.startPercent)
    11
    return false;
    11
    return false;
    12
    if (this.itemMargin != that.itemMargin)
    12
    if (this.itemMargin != that.itemMargin)
    12
    if (this.endPercent != that.endPercent)
    Differences
    Expression1Expression2Difference
    itemMarginendPercentVARIABLE_NAME_MISMATCH
    org.jfree.chart.renderer.category.BoxAndWhiskerRendererorg.jfree.chart.renderer.category.GanttRendererSUBCLASS_TYPE_MISMATCH
    itemMarginendPercentVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression that.itemMargin cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.endPercent cannot be parameterized, because it has dependencies to/from statements that will be extracted
    12
    if (this.endPercent != that.endPercent)
    13
    return false;
    13
    return false;
    16
    return true;
    16
    return true;
    14
    return super.equals(obj);
    Differences
    Expression1Expression2Difference
    truesuper.equals(obj)TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Super method call return super.equals(obj); cannot be extracted from method
    14
    return super.equals(obj);
    Precondition Violations (12)
    Row Violation
    1Expression PaintUtilities.equal(this.completePaint,that.completePaint) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Super method call if(!super.equals(obj)) cannot be extracted from method
    3Expression that.artifactPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression that.incompletePaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Type boolean of variable this.fillBox does not match with type double of variable this.startPercent
    6Expression that.fillBox cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression that.startPercent cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Type boolean of variable that.fillBox does not match with type double of variable that.startPercent
    9Expression that.itemMargin cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10Expression that.endPercent cannot be parameterized, because it has dependencies to/from statements that will be extracted
    11Super method call return super.equals(obj); cannot be extracted from method
    12Not all possible execution flows end in a return statement