if (obj == this) { return true; } if (!super.equals(obj)) { return false; } if (!(obj instanceof XYLineAnnotation)) { return false; } XYLineAnnotation that = (XYLineAnnotation) obj; if (this.x1 != that.x1) { return false; } if (this.y1 != that.y1) { return false; } if (this.x2 != that.x2) { return false; } if (this.y2 != that.y2) { return false; } if (!PaintUtilities.equal(this.paint, that.paint)) { return false; } if (!ObjectUtilities.equal(this.stroke, that.stroke)) { return false; } // seems to be the same... return true;
if (obj == this) { return true; } if (!(obj instanceof ScatterRenderer)) { return false; } ScatterRenderer that = (ScatterRenderer) obj; if (!ObjectUtilities.equal(this.seriesShapesFilled, that.seriesShapesFilled)) { return false; } if (this.baseShapesFilled != that.baseShapesFilled) { return false; } if (this.useFillPaint != that.useFillPaint) { return false; } if (this.drawOutlines != that.drawOutlines) { return false; } if (this.useOutlinePaint != that.useOutlinePaint) { return false; } if (this.useSeriesOffset != that.useSeriesOffset) { return false; } if (this.itemMargin != that.itemMargin) { return false; } return super.equals(obj);
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/annotations/XYLineAnnotation.java File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/category/ScatterRenderer.java
Method name: boolean equals(Object) Method name: boolean equals(Object)
Number of AST nodes: 20 Number of AST nodes: 20
1
if (obj == this) {
1
if (obj == this) {
2
            return true;
2
            return true;
3
        }
3
        }
4
        if (!super.equals(obj)) {
4
        if (!
5
            return false;
6
        }
7
        if (!(obj instanceof XYLineAnnotation)) {
8
            return false;
9
        }
10
        XYLineAnnotation that = (XYLineAnnotation) obj;
11
        if (this.x1 != that.x1
5
(obj instanceof ScatterRenderer)) {
6
            return false;
7
        }
8
        ScatterRenderer that = (ScatterRenderer) obj;
9
        if (!ObjectUtilities.equal(this.seriesShapesFilled,
12
) {
10
                that.seriesShapesFilled)) {
13
            return false;
11
            return false;
14
        }
12
        }
15
        if (this.y1 != that.y1) {
13
        if (this.baseShapesFilled != that.baseShapesFilled) {
16
            return false;
14
            return false;
17
        }
15
        }
18
        if (this.x2 != that.x2) {
16
        if (this.useFillPaint != that.useFillPaint) {
19
            return false;
17
            return false;
20
        }
18
        }
21
        if (this.y2 != that.y2) {
19
        if (this.drawOutlines != that.drawOutlines) {
22
            return false;
20
            return false;
23
        }
21
        }
24
        if (!PaintUtilities.equal(this.paint, that.paint)) {
22
        if (this.useOutlinePaint != that.useOutlinePaint) {
25
            return false;
23
            return false;
26
        }
24
        }
27
        if (!ObjectUtilities.equal(this.stroke, that.stroke)) {
25
        if (this.useSeriesOffset != that.useSeriesOffset) {
28
            return false;
26
            return false;
29
        }
27
        }
30
        // seems to be the same...
28
        
29
if (this.itemMargin != that.itemMargin) {
31
        return true
30
            return false;
31
        }
32
;
32
        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)8.0
Clones locationClones are in different classes
Number of node comparisons124
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements14
    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 (!super.equals(obj))
    3
    if (!super.equals(obj))
    3
    if (!(obj instanceof ScatterRenderer))
    Differences
    Expression1Expression2Difference
    super.equals(obj)(obj instanceof ScatterRenderer)TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Super method call if(!super.equals(obj)) cannot be extracted from method
    3
    if (!(obj instanceof ScatterRenderer))
    4
    return false;
    4
    return false;
                                                                                              
    5
    ScatterRenderer that = (ScatterRenderer)obj;
    5
    if (!(obj instanceof XYLineAnnotation))
    5
    if (!(obj instanceof XYLineAnnotation))
    6
    if (!ObjectUtilities.equal(this.seriesShapesFilled, that.seriesShapesFilled))
    Differences
    Expression1Expression2Difference
    (obj instanceof XYLineAnnotation)ObjectUtilities.equal(this.seriesShapesFilled,that.seriesShapesFilled)TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression ObjectUtilities.equal(this.seriesShapesFilled,that.seriesShapesFilled) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6
    if (!ObjectUtilities.equal(this.seriesShapesFilled, that.seriesShapesFilled))
    6
    return false;
    7
    return false;
    7
    XYLineAnnotation that = (XYLineAnnotation)obj;
                                                                                                  
    8
    if (this.x1 != that.x1)
    8
    if (this.x1 != that.x1)
    8
    if (this.baseShapesFilled != that.baseShapesFilled)
    Differences
    Expression1Expression2Difference
    x1baseShapesFilledVARIABLE_NAME_MISMATCH
    doublebooleanVARIABLE_TYPE_MISMATCH
    org.jfree.chart.annotations.XYLineAnnotationorg.jfree.chart.renderer.category.ScatterRendererSUBCLASS_TYPE_MISMATCH
    x1baseShapesFilledVARIABLE_NAME_MISMATCH
    doublebooleanVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type double of variable this.x1 does not match with type boolean of variable this.baseShapesFilled
    Expression that.x1 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.baseShapesFilled cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type double of variable that.x1 does not match with type boolean of variable that.baseShapesFilled
    8
    if (this.baseShapesFilled != that.baseShapesFilled)
    9
    return false;
    9
    return false;
    10
    if (this.y1 != that.y1)
    10
    if (this.y1 != that.y1)
    10
    if (this.useFillPaint != that.useFillPaint)
    Differences
    Expression1Expression2Difference
    y1useFillPaintVARIABLE_NAME_MISMATCH
    doublebooleanVARIABLE_TYPE_MISMATCH
    org.jfree.chart.annotations.XYLineAnnotationorg.jfree.chart.renderer.category.ScatterRendererSUBCLASS_TYPE_MISMATCH
    y1useFillPaintVARIABLE_NAME_MISMATCH
    doublebooleanVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type double of variable this.y1 does not match with type boolean of variable this.useFillPaint
    Expression that.y1 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.useFillPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type double of variable that.y1 does not match with type boolean of variable that.useFillPaint
    10
    if (this.useFillPaint != that.useFillPaint)
    11
    return false;
    11
    return false;
    12
    if (this.x2 != that.x2)
    12
    if (this.x2 != that.x2)
    12
    if (this.drawOutlines != that.drawOutlines)
    Differences
    Expression1Expression2Difference
    x2drawOutlinesVARIABLE_NAME_MISMATCH
    doublebooleanVARIABLE_TYPE_MISMATCH
    org.jfree.chart.annotations.XYLineAnnotationorg.jfree.chart.renderer.category.ScatterRendererSUBCLASS_TYPE_MISMATCH
    x2drawOutlinesVARIABLE_NAME_MISMATCH
    doublebooleanVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type double of variable this.x2 does not match with type boolean of variable this.drawOutlines
    Expression that.x2 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.drawOutlines cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type double of variable that.x2 does not match with type boolean of variable that.drawOutlines
    12
    if (this.drawOutlines != that.drawOutlines)
    13
    return false;
    13
    return false;
    14
    if (this.y2 != that.y2)
    14
    if (this.y2 != that.y2)
    14
    if (this.useOutlinePaint != that.useOutlinePaint)
    Differences
    Expression1Expression2Difference
    y2useOutlinePaintVARIABLE_NAME_MISMATCH
    doublebooleanVARIABLE_TYPE_MISMATCH
    org.jfree.chart.annotations.XYLineAnnotationorg.jfree.chart.renderer.category.ScatterRendererSUBCLASS_TYPE_MISMATCH
    y2useOutlinePaintVARIABLE_NAME_MISMATCH
    doublebooleanVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type double of variable this.y2 does not match with type boolean of variable this.useOutlinePaint
    Expression that.y2 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.useOutlinePaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type double of variable that.y2 does not match with type boolean of variable that.useOutlinePaint
    14
    if (this.useOutlinePaint != that.useOutlinePaint)
    15
    return false;
    15
    return false;
    Precondition Violations (20)
    Row Violation
    1Super method call if(!super.equals(obj)) cannot be extracted from method
    2Expression ObjectUtilities.equal(this.seriesShapesFilled,that.seriesShapesFilled) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Type double of variable this.x1 does not match with type boolean of variable this.baseShapesFilled
    4Expression that.x1 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression that.baseShapesFilled cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Type double of variable that.x1 does not match with type boolean of variable that.baseShapesFilled
    7Type double of variable this.y1 does not match with type boolean of variable this.useFillPaint
    8Expression that.y1 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    9Expression that.useFillPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10Type double of variable that.y1 does not match with type boolean of variable that.useFillPaint
    11Type double of variable this.x2 does not match with type boolean of variable this.drawOutlines
    12Expression that.x2 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    13Expression that.drawOutlines cannot be parameterized, because it has dependencies to/from statements that will be extracted
    14Type double of variable that.x2 does not match with type boolean of variable that.drawOutlines
    15Type double of variable this.y2 does not match with type boolean of variable this.useOutlinePaint
    16Expression that.y2 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    17Expression that.useOutlinePaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    18Type double of variable that.y2 does not match with type boolean of variable that.useOutlinePaint
    19Not all possible execution flows end in a return statement
    20The refactoring of the clones is infeasible, because classes org.jfree.chart.annotations.XYLineAnnotation and org.jfree.chart.renderer.category.ScatterRenderer do not have a common superclass