if (obj == this) { return true; } if (!(obj instanceof XYTitleAnnotation)) { return false; } XYTitleAnnotation that = (XYTitleAnnotation) obj; if (this.coordinateType != that.coordinateType) { return false; } if (this.x != that.x) { return false; } if (this.y != that.y) { return false; } if (this.maxWidth != that.maxWidth) { return false; } if (this.maxHeight != that.maxHeight) { return false; } if (!ObjectUtilities.equal(this.title, that.title)) { return false; } if (!this.anchor.equals(that.anchor)) { return false; } return super.equals(obj);
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/experimental/org/jfree/experimental/chart/annotations/XYTitleAnnotation.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 (!(obj instanceof XYTitleAnnotation)) {
4
        if (!(obj instanceof ScatterRenderer)) {
5
            return false;
5
            return false;
6
        }
6
        }
7
        XYTitleAnnotation that = (XYTitleAnnotation) obj;
7
        ScatterRenderer that = (ScatterRenderer) obj;
8
        if (this.coordinateType != that.coordinateType
8
        if (!ObjectUtilities.equal(this.seriesShapesFilled,
9
) {
9
                that.seriesShapesFilled)) {
10
            return false;
10
            return false;
11
        }
11
        }
12
        if (this.x != that.x) {
12
        if (this.baseShapesFilled != that.baseShapesFilled) {
13
            return false;
13
            return false;
14
        }
14
        }
15
        if (this.y != that.y) {
15
        if (this.useFillPaint != that.useFillPaint) {
16
            return false;
16
            return false;
17
        }
17
        }
18
        if (this.maxWidth != that.maxWidth) {
18
        if (this.drawOutlines != that.drawOutlines) {
19
            return false;
19
            return false;
20
        }
20
        }
21
        if (this.maxHeight != that.maxHeight) {
21
        if (this.useOutlinePaint != that.useOutlinePaint) {
22
            return false;
22
            return false;
23
        }
23
        }
24
        if (!ObjectUtilities.equal(this.title, that.title)) {
24
        if (this.useSeriesOffset != that.useSeriesOffset) {
25
            return false;
25
            return false;
26
        }
26
        }
27
        if (!this.anchor.equals(that.anchor)) {
27
        if (this.itemMargin != that.itemMargin) {
28
            return false;
28
            return false;
29
        }
29
        }
30
        return super.equals(obj);
30
        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)9.3
Clones locationClones are in different classes
Number of node comparisons139
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements17
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)7.8
    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 XYTitleAnnotation))
    3
    if (!(obj instanceof XYTitleAnnotation))
    3
    if (!(obj instanceof ScatterRenderer))
    Differences
    Expression1Expression2Difference
    org.jfree.experimental.chart.annotations.XYTitleAnnotationorg.jfree.chart.renderer.category.ScatterRendererSUBCLASS_TYPE_MISMATCH
    3
    if (!(obj instanceof ScatterRenderer))
    4
    return false;
    4
    return false;
    5
    XYTitleAnnotation that = (XYTitleAnnotation)obj;
    5
    XYTitleAnnotation that = (XYTitleAnnotation)obj;
    5
    ScatterRenderer that = (ScatterRenderer)obj;
    Differences
    Expression1Expression2Difference
    org.jfree.experimental.chart.annotations.XYTitleAnnotationorg.jfree.chart.renderer.category.ScatterRendererSUBCLASS_TYPE_MISMATCH
    org.jfree.experimental.chart.annotations.XYTitleAnnotationorg.jfree.chart.renderer.category.ScatterRendererSUBCLASS_TYPE_MISMATCH
    org.jfree.experimental.chart.annotations.XYTitleAnnotationorg.jfree.chart.renderer.category.ScatterRendererSUBCLASS_TYPE_MISMATCH
    5
    ScatterRenderer that = (ScatterRenderer)obj;
    6
    if (this.coordinateType != that.coordinateType)
    6
    if (this.coordinateType != that.coordinateType)
    8
    if (this.baseShapesFilled != that.baseShapesFilled)
    Differences
    Expression1Expression2Difference
    coordinateTypebaseShapesFilledVARIABLE_NAME_MISMATCH
    org.jfree.experimental.chart.util.XYCoordinateTypebooleanVARIABLE_TYPE_MISMATCH
    org.jfree.experimental.chart.annotations.XYTitleAnnotationorg.jfree.chart.renderer.category.ScatterRendererSUBCLASS_TYPE_MISMATCH
    coordinateTypebaseShapesFilledVARIABLE_NAME_MISMATCH
    org.jfree.experimental.chart.util.XYCoordinateTypebooleanVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jfree.experimental.chart.util.XYCoordinateType of variable this.coordinateType does not match with type boolean of variable this.baseShapesFilled
    Expression that.coordinateType 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 org.jfree.experimental.chart.util.XYCoordinateType of variable that.coordinateType does not match with type boolean of variable that.baseShapesFilled
    8
    if (this.baseShapesFilled != that.baseShapesFilled)
    7
    return false;
    9
    return false;
    8
    if (this.x != that.x)
    8
    if (this.x != that.x)
    10
    if (this.useFillPaint != that.useFillPaint)
    Differences
    Expression1Expression2Difference
    xuseFillPaintVARIABLE_NAME_MISMATCH
    doublebooleanVARIABLE_TYPE_MISMATCH
    org.jfree.experimental.chart.annotations.XYTitleAnnotationorg.jfree.chart.renderer.category.ScatterRendererSUBCLASS_TYPE_MISMATCH
    xuseFillPaintVARIABLE_NAME_MISMATCH
    doublebooleanVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type double of variable this.x does not match with type boolean of variable this.useFillPaint
    Expression that.x 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.x does not match with type boolean of variable that.useFillPaint
    10
    if (this.useFillPaint != that.useFillPaint)
    9
    return false;
    11
    return false;
    10
    if (this.y != that.y)
    10
    if (this.y != that.y)
    12
    if (this.drawOutlines != that.drawOutlines)
    Differences
    Expression1Expression2Difference
    ydrawOutlinesVARIABLE_NAME_MISMATCH
    doublebooleanVARIABLE_TYPE_MISMATCH
    org.jfree.experimental.chart.annotations.XYTitleAnnotationorg.jfree.chart.renderer.category.ScatterRendererSUBCLASS_TYPE_MISMATCH
    ydrawOutlinesVARIABLE_NAME_MISMATCH
    doublebooleanVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type double of variable this.y does not match with type boolean of variable this.drawOutlines
    Expression that.y 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.y does not match with type boolean of variable that.drawOutlines
    12
    if (this.drawOutlines != that.drawOutlines)
    11
    return false;
    13
    return false;
    12
    if (this.maxWidth != that.maxWidth)
    12
    if (this.maxWidth != that.maxWidth)
    14
    if (this.useOutlinePaint != that.useOutlinePaint)
    Differences
    Expression1Expression2Difference
    maxWidthuseOutlinePaintVARIABLE_NAME_MISMATCH
    doublebooleanVARIABLE_TYPE_MISMATCH
    org.jfree.experimental.chart.annotations.XYTitleAnnotationorg.jfree.chart.renderer.category.ScatterRendererSUBCLASS_TYPE_MISMATCH
    maxWidthuseOutlinePaintVARIABLE_NAME_MISMATCH
    doublebooleanVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type double of variable this.maxWidth does not match with type boolean of variable this.useOutlinePaint
    Expression that.maxWidth 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.maxWidth does not match with type boolean of variable that.useOutlinePaint
    14
    if (this.useOutlinePaint != that.useOutlinePaint)
    13
    return false;
    15
    return false;
    14
    if (this.maxHeight != that.maxHeight)
    14
    if (this.maxHeight != that.maxHeight)
    16
    if (this.useSeriesOffset != that.useSeriesOffset)
    Differences
    Expression1Expression2Difference
    maxHeightuseSeriesOffsetVARIABLE_NAME_MISMATCH
    doublebooleanVARIABLE_TYPE_MISMATCH
    org.jfree.experimental.chart.annotations.XYTitleAnnotationorg.jfree.chart.renderer.category.ScatterRendererSUBCLASS_TYPE_MISMATCH
    maxHeightuseSeriesOffsetVARIABLE_NAME_MISMATCH
    doublebooleanVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type double of variable this.maxHeight does not match with type boolean of variable this.useSeriesOffset
    Expression that.maxHeight cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.useSeriesOffset cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type double of variable that.maxHeight does not match with type boolean of variable that.useSeriesOffset
    16
    if (this.useSeriesOffset != that.useSeriesOffset)
    15
    return false;
    17
    return false;
    16
    if (!ObjectUtilities.equal(this.title, that.title))
    16
    if (!ObjectUtilities.equal(this.title, that.title))
    6
    if (!ObjectUtilities.equal(this.seriesShapesFilled, that.seriesShapesFilled))
    Differences
    Expression1Expression2Difference
    titleseriesShapesFilledVARIABLE_NAME_MISMATCH
    org.jfree.chart.title.Titleorg.jfree.util.BooleanListVARIABLE_TYPE_MISMATCH
    org.jfree.experimental.chart.annotations.XYTitleAnnotationorg.jfree.chart.renderer.category.ScatterRendererSUBCLASS_TYPE_MISMATCH
    titleseriesShapesFilledVARIABLE_NAME_MISMATCH
    org.jfree.chart.title.Titleorg.jfree.util.BooleanListVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jfree.chart.title.Title of variable this.title does not match with type org.jfree.util.BooleanList of variable this.seriesShapesFilled
    • Make classes org.jfree.chart.title.Title and org.jfree.util.BooleanList extend a common superclass
    Expression that.title cannot be unified with expression that.seriesShapesFilled , because common superclass type java.lang.Cloneable cannot be passed as an argument to public static boolean equal(java.lang.Object, java.lang.Object)
    Expression that.title cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.seriesShapesFilled cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type org.jfree.chart.title.Title of variable that.title does not match with type org.jfree.util.BooleanList of variable that.seriesShapesFilled
    • Make classes org.jfree.chart.title.Title and org.jfree.util.BooleanList extend a common superclass
    6
    if (!ObjectUtilities.equal(this.seriesShapesFilled, that.seriesShapesFilled))
    17
    return false;
    7
    return false;
    Precondition Violations (28)
    Row Violation
    1Type org.jfree.experimental.chart.util.XYCoordinateType of variable this.coordinateType does not match with type boolean of variable this.baseShapesFilled
    2Expression that.coordinateType cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression that.baseShapesFilled cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Type org.jfree.experimental.chart.util.XYCoordinateType of variable that.coordinateType does not match with type boolean of variable that.baseShapesFilled
    5Type double of variable this.x does not match with type boolean of variable this.useFillPaint
    6Expression that.x cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression that.useFillPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Type double of variable that.x does not match with type boolean of variable that.useFillPaint
    9Type double of variable this.y does not match with type boolean of variable this.drawOutlines
    10Expression that.y cannot be parameterized, because it has dependencies to/from statements that will be extracted
    11Expression that.drawOutlines cannot be parameterized, because it has dependencies to/from statements that will be extracted
    12Type double of variable that.y does not match with type boolean of variable that.drawOutlines
    13Type double of variable this.maxWidth does not match with type boolean of variable this.useOutlinePaint
    14Expression that.maxWidth cannot be parameterized, because it has dependencies to/from statements that will be extracted
    15Expression that.useOutlinePaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    16Type double of variable that.maxWidth does not match with type boolean of variable that.useOutlinePaint
    17Type double of variable this.maxHeight does not match with type boolean of variable this.useSeriesOffset
    18Expression that.maxHeight cannot be parameterized, because it has dependencies to/from statements that will be extracted
    19Expression that.useSeriesOffset cannot be parameterized, because it has dependencies to/from statements that will be extracted
    20Type double of variable that.maxHeight does not match with type boolean of variable that.useSeriesOffset
    21Type org.jfree.chart.title.Title of variable this.title does not match with type org.jfree.util.BooleanList of variable this.seriesShapesFilled
    22Expression that.title cannot be unified with expression that.seriesShapesFilled , because common superclass type java.lang.Cloneable cannot be passed as an argument to public static boolean equal(java.lang.Object, java.lang.Object)
    23Expression that.title cannot be parameterized, because it has dependencies to/from statements that will be extracted
    24Expression that.seriesShapesFilled cannot be parameterized, because it has dependencies to/from statements that will be extracted
    25Type org.jfree.chart.title.Title of variable that.title does not match with type org.jfree.util.BooleanList of variable that.seriesShapesFilled
    26Clone fragment #1 returns variable that with type org.jfree.experimental.chart.annotations.XYTitleAnnotation , while Clone fragment #2 returns variable that with type org.jfree.chart.renderer.category.ScatterRenderer
    27Not all possible execution flows end in a return statement
    28The refactoring of the clones is infeasible, because classes org.jfree.experimental.chart.annotations.XYTitleAnnotation and org.jfree.chart.renderer.category.ScatterRenderer do not have a common superclass