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 CyclicNumberAxis)) { return false; } if (!super.equals(obj)) { return false; } CyclicNumberAxis that = (CyclicNumberAxis) obj; if (this.period != that.period) { return false; } if (this.offset != that.offset) { return false; } if (!PaintUtilities.equal(this.advanceLinePaint, that.advanceLinePaint)) { return false; } if (!ObjectUtilities.equal(this.advanceLineStroke, that.advanceLineStroke)) { return false; } if (this.advanceLineVisible != that.advanceLineVisible) { return false; } if (this.boundMappedToLastCycle != that.boundMappedToLastCycle) { return false; } return true;
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/axis/CyclicNumberAxis.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 (!(obj instanceof CyclicNumberAxis)) {
5
            return false;
5
            return false;
6
        }
6
        }
7
        if (!(obj instanceof XYLineAnnotation)) {
7
        if (!super.equals(obj)) {
8
            return false;
8
            return false;
9
        }
9
        }
10
        XYLineAnnotation that = (XYLineAnnotation) obj;
10
        CyclicNumberAxis that = (CyclicNumberAxis) obj;      
11
        if (this.x1 != that.x1) {
11
        if (this.period != that.period) {
12
            return false;
12
            return false;
13
        }
13
        }
14
        if (this.y1 != that.y1) {
14
        if (this.offset != that.offset) {
15
            return false;
15
            return false;
16
        }
16
        }
17
        if (this.x2 != that.x2) {
17
        if (
18
            return false;
19
        }
20
        if (this.y2 != that.y2
18
!PaintUtilities.equal(this.advanceLinePaint, 
19
                that.advanceLinePaint)) {
20
            return false;
21
        }
22
        if (!ObjectUtilities.equal(this.advanceLineStroke, 
21
) {
23
                that.advanceLineStroke)) {
22
            return false;
24
            return false;
23
        }
25
        }
24
        if (!PaintUtilities.equal(this.paint, that.paint)) {
26
        if (this.advanceLineVisible != that.advanceLineVisible) {
25
            return false;
27
            return false;
26
        }
28
        }
27
        if (!ObjectUtilities.equal(this.stroke, that.stroke)) {
29
        if (this.boundMappedToLastCycle != that.boundMappedToLastCycle) {
28
            return false;
30
            return false;
29
        }
31
        }
30
        // seems to be the same...
31
        return true;
32
        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)7.3
Clones locationClones are in different classes
Number of node comparisons148
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements20
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)8.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 (!super.equals(obj))
    3
    if (!super.equals(obj))
    5
    if (!super.equals(obj))
    Preondition Violations
    Super method call if(!super.equals(obj)) cannot be extracted from method
    Super method call if(!super.equals(obj)) cannot be extracted from method
    5
    if (!super.equals(obj))
    4
    return false;
    6
    return false;
    5
    if (!(obj instanceof XYLineAnnotation))
    5
    if (!(obj instanceof XYLineAnnotation))
    3
    if (!(obj instanceof CyclicNumberAxis))
    Differences
    Expression1Expression2Difference
    org.jfree.chart.annotations.XYLineAnnotationorg.jfree.chart.axis.CyclicNumberAxisSUBCLASS_TYPE_MISMATCH
    3
    if (!(obj instanceof CyclicNumberAxis))
    6
    return false;
    4
    return false;
    7
    XYLineAnnotation that = (XYLineAnnotation)obj;
    7
    XYLineAnnotation that = (XYLineAnnotation)obj;
    7
    CyclicNumberAxis that = (CyclicNumberAxis)obj;
    Differences
    Expression1Expression2Difference
    org.jfree.chart.annotations.XYLineAnnotationorg.jfree.chart.axis.CyclicNumberAxisSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.annotations.XYLineAnnotationorg.jfree.chart.axis.CyclicNumberAxisSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.annotations.XYLineAnnotationorg.jfree.chart.axis.CyclicNumberAxisSUBCLASS_TYPE_MISMATCH
    7
    CyclicNumberAxis that = (CyclicNumberAxis)obj;
    8
    if (this.x1 != that.x1)
    8
    if (this.x1 != that.x1)
    8
    if (this.period != that.period)
    Differences
    Expression1Expression2Difference
    x1periodVARIABLE_NAME_MISMATCH
    org.jfree.chart.annotations.XYLineAnnotationorg.jfree.chart.axis.CyclicNumberAxisSUBCLASS_TYPE_MISMATCH
    x1periodVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression that.x1 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.period cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8
    if (this.period != that.period)
    9
    return false;
    9
    return false;
    10
    if (this.y1 != that.y1)
    10
    if (this.y1 != that.y1)
    10
    if (this.offset != that.offset)
    Differences
    Expression1Expression2Difference
    y1offsetVARIABLE_NAME_MISMATCH
    org.jfree.chart.annotations.XYLineAnnotationorg.jfree.chart.axis.CyclicNumberAxisSUBCLASS_TYPE_MISMATCH
    y1offsetVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression that.y1 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.offset cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10
    if (this.offset != that.offset)
    11
    return false;
    11
    return false;
    12
    if (this.x2 != that.x2)
    12
    if (this.x2 != that.x2)
    16
    if (this.advanceLineVisible != that.advanceLineVisible)
    Differences
    Expression1Expression2Difference
    x2advanceLineVisibleVARIABLE_NAME_MISMATCH
    doublebooleanVARIABLE_TYPE_MISMATCH
    org.jfree.chart.annotations.XYLineAnnotationorg.jfree.chart.axis.CyclicNumberAxisSUBCLASS_TYPE_MISMATCH
    x2advanceLineVisibleVARIABLE_NAME_MISMATCH
    doublebooleanVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type double of variable this.x2 does not match with type boolean of variable this.advanceLineVisible
    Expression that.x2 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.advanceLineVisible 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.advanceLineVisible
    16
    if (this.advanceLineVisible != that.advanceLineVisible)
    13
    return false;
    17
    return false;
    14
    if (this.y2 != that.y2)
    14
    if (this.y2 != that.y2)
    18
    if (this.boundMappedToLastCycle != that.boundMappedToLastCycle)
    Differences
    Expression1Expression2Difference
    y2boundMappedToLastCycleVARIABLE_NAME_MISMATCH
    doublebooleanVARIABLE_TYPE_MISMATCH
    org.jfree.chart.annotations.XYLineAnnotationorg.jfree.chart.axis.CyclicNumberAxisSUBCLASS_TYPE_MISMATCH
    y2boundMappedToLastCycleVARIABLE_NAME_MISMATCH
    doublebooleanVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type double of variable this.y2 does not match with type boolean of variable this.boundMappedToLastCycle
    Expression that.y2 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.boundMappedToLastCycle 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.boundMappedToLastCycle
    18
    if (this.boundMappedToLastCycle != that.boundMappedToLastCycle)
    15
    return false;
    19
    return false;
    16
    if (!PaintUtilities.equal(this.paint, that.paint))
    16
    if (!PaintUtilities.equal(this.paint, that.paint))
    12
    if (!PaintUtilities.equal(this.advanceLinePaint, that.advanceLinePaint))
    Differences
    Expression1Expression2Difference
    paintadvanceLinePaintVARIABLE_NAME_MISMATCH
    org.jfree.chart.annotations.XYLineAnnotationorg.jfree.chart.axis.CyclicNumberAxisSUBCLASS_TYPE_MISMATCH
    paintadvanceLinePaintVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression that.paint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.advanceLinePaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    12
    if (!PaintUtilities.equal(this.advanceLinePaint, that.advanceLinePaint))
    17
    return false;
    13
    return false;
    18
    if (!ObjectUtilities.equal(this.stroke, that.stroke))
    18
    if (!ObjectUtilities.equal(this.stroke, that.stroke))
    14
    if (!ObjectUtilities.equal(this.advanceLineStroke, that.advanceLineStroke))
    Differences
    Expression1Expression2Difference
    strokeadvanceLineStrokeVARIABLE_NAME_MISMATCH
    org.jfree.chart.annotations.XYLineAnnotationorg.jfree.chart.axis.CyclicNumberAxisSUBCLASS_TYPE_MISMATCH
    strokeadvanceLineStrokeVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression that.stroke cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.advanceLineStroke cannot be parameterized, because it has dependencies to/from statements that will be extracted
    14
    if (!ObjectUtilities.equal(this.advanceLineStroke, that.advanceLineStroke))
    19
    return false;
    15
    return false;
    20
    return true;
    20
    return true;
    Precondition Violations (19)
    Row Violation
    1Super method call if(!super.equals(obj)) cannot be extracted from method
    2Super method call if(!super.equals(obj)) cannot be extracted from method
    3Expression that.x1 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression that.period cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression that.y1 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression that.offset cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Type double of variable this.x2 does not match with type boolean of variable this.advanceLineVisible
    8Expression that.x2 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    9Expression that.advanceLineVisible cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10Type double of variable that.x2 does not match with type boolean of variable that.advanceLineVisible
    11Type double of variable this.y2 does not match with type boolean of variable this.boundMappedToLastCycle
    12Expression that.y2 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    13Expression that.boundMappedToLastCycle cannot be parameterized, because it has dependencies to/from statements that will be extracted
    14Type double of variable that.y2 does not match with type boolean of variable that.boundMappedToLastCycle
    15Expression that.paint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    16Expression that.advanceLinePaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    17Expression that.stroke cannot be parameterized, because it has dependencies to/from statements that will be extracted
    18Expression that.advanceLineStroke cannot be parameterized, because it has dependencies to/from statements that will be extracted
    19The refactoring of the clones is infeasible, because classes org.jfree.chart.annotations.XYLineAnnotation and org.jfree.chart.axis.CyclicNumberAxis do not have a common superclass