if (obj == this) { return true; } if (!(obj instanceof CategoryPointerAnnotation)) { return false; } if (!super.equals(obj)) { return false; } CategoryPointerAnnotation that = (CategoryPointerAnnotation) obj; if (this.angle != that.angle) { return false; } if (this.tipRadius != that.tipRadius) { return false; } if (this.baseRadius != that.baseRadius) { return false; } if (this.arrowLength != that.arrowLength) { return false; } if (this.arrowWidth != that.arrowWidth) { return false; } if (!this.arrowPaint.equals(that.arrowPaint)) { return false; } if (!ObjectUtilities.equal(this.arrowStroke, that.arrowStroke)) { return false; } if (this.labelOffset != that.labelOffset) { return false; } return true;
if (obj == this) { return true; } if (!(obj instanceof XYPointerAnnotation)) { return false; } if (!super.equals(obj)) { return false; } XYPointerAnnotation that = (XYPointerAnnotation) obj; if (this.angle != that.angle) { return false; } if (this.tipRadius != that.tipRadius) { return false; } if (this.baseRadius != that.baseRadius) { return false; } if (this.arrowLength != that.arrowLength) { return false; } if (this.arrowWidth != that.arrowWidth) { return false; } if (!this.arrowPaint.equals(that.arrowPaint)) { return false; } if (!ObjectUtilities.equal(this.arrowStroke, that.arrowStroke)) { return false; } if (this.labelOffset != that.labelOffset) { return false; } return true;
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/annotations/CategoryPointerAnnotation.java File path: /jfreechart-1.0.10/src/org/jfree/chart/annotations/XYPointerAnnotation.java
Method name: boolean equals(Object) Method name: boolean equals(Object)
Number of AST nodes: 24 Number of AST nodes: 24
1
if (obj == this) {
1
if (obj == this) {
2
            return true;
2
            return true;
3
        }
3
        }
4
        if (!(obj instanceof CategoryPointerAnnotation)) {
4
        if (!(obj instanceof XYPointerAnnotation)) {
5
            return false;
5
            return false;
6
        }
6
        }
7
        if (!super.equals(obj)) {
7
        if (!super.equals(obj)) {
8
            return false;
8
            return false;
9
        }
9
        }
10
        CategoryPointerAnnotation that = (CategoryPointerAnnotation) obj;
10
        XYPointerAnnotation that = (XYPointerAnnotation) obj;
11
        if (this.angle != that.angle) {
11
        if (this.angle != that.angle) {
12
            return false;
12
            return false;
13
        }
13
        }
14
        if (this.tipRadius != that.tipRadius) {
14
        if (this.tipRadius != that.tipRadius) {
15
            return false;
15
            return false;
16
        }
16
        }
17
        if (this.baseRadius != that.baseRadius) {
17
        if (this.baseRadius != that.baseRadius) {
18
            return false;
18
            return false;
19
        }
19
        }
20
        if (this.arrowLength != that.arrowLength) {
20
        if (this.arrowLength != that.arrowLength) {
21
            return false;
21
            return false;
22
        }
22
        }
23
        if (this.arrowWidth != that.arrowWidth) {
23
        if (this.arrowWidth != that.arrowWidth) {
24
            return false;
24
            return false;
25
        }
25
        }
26
        if (!this.arrowPaint.equals(that.arrowPaint)) {
26
        if (!this.arrowPaint.equals(that.arrowPaint)) {
27
            return false;
27
            return false;
28
        }
28
        }
29
        if (!ObjectUtilities.equal(this.arrowStroke, that.arrowStroke)) {
29
        if (!ObjectUtilities.equal(this.arrowStroke, that.arrowStroke)) {
30
            return false;
30
            return false;
31
        }
31
        }
32
        if (this.labelOffset != that.labelOffset) {
32
        if (this.labelOffset != that.labelOffset) {
33
            return false;
33
            return false;
34
        }
34
        }
35
        return true;
35
        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)13.3
Clones locationClones are in different classes
Number of node comparisons221
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements24
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)10.3
    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 CategoryPointerAnnotation))
    3
    if (!(obj instanceof CategoryPointerAnnotation))
    3
    if (!(obj instanceof XYPointerAnnotation))
    Differences
    Expression1Expression2Difference
    org.jfree.chart.annotations.CategoryPointerAnnotationorg.jfree.chart.annotations.XYPointerAnnotationSUBCLASS_TYPE_MISMATCH
    3
    if (!(obj instanceof XYPointerAnnotation))
    4
    return false;
    4
    return false;
    5
    if (!super.equals(obj))
    5
    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))
    6
    return false;
    6
    return false;
    7
    CategoryPointerAnnotation that = (CategoryPointerAnnotation)obj;
    7
    CategoryPointerAnnotation that = (CategoryPointerAnnotation)obj;
    7
    XYPointerAnnotation that = (XYPointerAnnotation)obj;
    Differences
    Expression1Expression2Difference
    org.jfree.chart.annotations.CategoryPointerAnnotationorg.jfree.chart.annotations.XYPointerAnnotationSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.annotations.CategoryPointerAnnotationorg.jfree.chart.annotations.XYPointerAnnotationSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.annotations.CategoryPointerAnnotationorg.jfree.chart.annotations.XYPointerAnnotationSUBCLASS_TYPE_MISMATCH
    7
    XYPointerAnnotation that = (XYPointerAnnotation)obj;
    8
    if (this.angle != that.angle)
    8
    if (this.angle != that.angle)
    8
    if (this.angle != that.angle)
    Differences
    Expression1Expression2Difference
    org.jfree.chart.annotations.CategoryPointerAnnotationorg.jfree.chart.annotations.XYPointerAnnotationSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression that.angle cannot be unified with expression that.angle , because common superclass org.jfree.util.PublicCloneable does not declare member(s) private double angle
    8
    if (this.angle != that.angle)
    9
    return false;
    9
    return false;
    10
    if (this.tipRadius != that.tipRadius)
    10
    if (this.tipRadius != that.tipRadius)
    10
    if (this.tipRadius != that.tipRadius)
    Differences
    Expression1Expression2Difference
    org.jfree.chart.annotations.CategoryPointerAnnotationorg.jfree.chart.annotations.XYPointerAnnotationSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression that.tipRadius cannot be unified with expression that.tipRadius , because common superclass org.jfree.util.PublicCloneable does not declare member(s) private double tipRadius
    10
    if (this.tipRadius != that.tipRadius)
    11
    return false;
    11
    return false;
    12
    if (this.baseRadius != that.baseRadius)
    12
    if (this.baseRadius != that.baseRadius)
    12
    if (this.baseRadius != that.baseRadius)
    Differences
    Expression1Expression2Difference
    org.jfree.chart.annotations.CategoryPointerAnnotationorg.jfree.chart.annotations.XYPointerAnnotationSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression that.baseRadius cannot be unified with expression that.baseRadius , because common superclass org.jfree.util.PublicCloneable does not declare member(s) private double baseRadius
    12
    if (this.baseRadius != that.baseRadius)
    13
    return false;
    13
    return false;
    14
    if (this.arrowLength != that.arrowLength)
    14
    if (this.arrowLength != that.arrowLength)
    14
    if (this.arrowLength != that.arrowLength)
    Differences
    Expression1Expression2Difference
    org.jfree.chart.annotations.CategoryPointerAnnotationorg.jfree.chart.annotations.XYPointerAnnotationSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression that.arrowLength cannot be unified with expression that.arrowLength , because common superclass org.jfree.util.PublicCloneable does not declare member(s) private double arrowLength
    14
    if (this.arrowLength != that.arrowLength)
    15
    return false;
    15
    return false;
    16
    if (this.arrowWidth != that.arrowWidth)
    16
    if (this.arrowWidth != that.arrowWidth)
    16
    if (this.arrowWidth != that.arrowWidth)
    Differences
    Expression1Expression2Difference
    org.jfree.chart.annotations.CategoryPointerAnnotationorg.jfree.chart.annotations.XYPointerAnnotationSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression that.arrowWidth cannot be unified with expression that.arrowWidth , because common superclass org.jfree.util.PublicCloneable does not declare member(s) private double arrowWidth
    16
    if (this.arrowWidth != that.arrowWidth)
    17
    return false;
    17
    return false;
    18
    if (!this.arrowPaint.equals(that.arrowPaint))
    18
    if (!this.arrowPaint.equals(that.arrowPaint))
    18
    if (!this.arrowPaint.equals(that.arrowPaint))
    Differences
    Expression1Expression2Difference
    org.jfree.chart.annotations.CategoryPointerAnnotationorg.jfree.chart.annotations.XYPointerAnnotationSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression that.arrowPaint cannot be unified with expression that.arrowPaint , because common superclass org.jfree.util.PublicCloneable does not declare member(s) private transient java.awt.Paint arrowPaint
    18
    if (!this.arrowPaint.equals(that.arrowPaint))
    19
    return false;
    19
    return false;
    20
    if (!ObjectUtilities.equal(this.arrowStroke, that.arrowStroke))
    20
    if (!ObjectUtilities.equal(this.arrowStroke, that.arrowStroke))
    20
    if (!ObjectUtilities.equal(this.arrowStroke, that.arrowStroke))
    Differences
    Expression1Expression2Difference
    org.jfree.chart.annotations.CategoryPointerAnnotationorg.jfree.chart.annotations.XYPointerAnnotationSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression that.arrowStroke cannot be unified with expression that.arrowStroke , because common superclass org.jfree.util.PublicCloneable does not declare member(s) private transient java.awt.Stroke arrowStroke
    20
    if (!ObjectUtilities.equal(this.arrowStroke, that.arrowStroke))
    21
    return false;
    21
    return false;
    22
    if (this.labelOffset != that.labelOffset)
    22
    if (this.labelOffset != that.labelOffset)
    22
    if (this.labelOffset != that.labelOffset)
    Differences
    Expression1Expression2Difference
    org.jfree.chart.annotations.CategoryPointerAnnotationorg.jfree.chart.annotations.XYPointerAnnotationSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression that.labelOffset cannot be unified with expression that.labelOffset , because common superclass org.jfree.util.PublicCloneable does not declare member(s) private double labelOffset
    22
    if (this.labelOffset != that.labelOffset)
    23
    return false;
    23
    return false;
    24
    return true;
    24
    return true;
    Precondition Violations (11)
    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.angle cannot be unified with expression that.angle , because common superclass org.jfree.util.PublicCloneable does not declare member(s) private double angle
    4Expression that.tipRadius cannot be unified with expression that.tipRadius , because common superclass org.jfree.util.PublicCloneable does not declare member(s) private double tipRadius
    5Expression that.baseRadius cannot be unified with expression that.baseRadius , because common superclass org.jfree.util.PublicCloneable does not declare member(s) private double baseRadius
    6Expression that.arrowLength cannot be unified with expression that.arrowLength , because common superclass org.jfree.util.PublicCloneable does not declare member(s) private double arrowLength
    7Expression that.arrowWidth cannot be unified with expression that.arrowWidth , because common superclass org.jfree.util.PublicCloneable does not declare member(s) private double arrowWidth
    8Expression that.arrowPaint cannot be unified with expression that.arrowPaint , because common superclass org.jfree.util.PublicCloneable does not declare member(s) private transient java.awt.Paint arrowPaint
    9Expression that.arrowStroke cannot be unified with expression that.arrowStroke , because common superclass org.jfree.util.PublicCloneable does not declare member(s) private transient java.awt.Stroke arrowStroke
    10Expression that.labelOffset cannot be unified with expression that.labelOffset , because common superclass org.jfree.util.PublicCloneable does not declare member(s) private double labelOffset
    11The refactoring of the clones is infeasible, because classes org.jfree.chart.annotations.CategoryPointerAnnotation and org.jfree.chart.annotations.XYPointerAnnotation do not have a common superclass