if (obj == this) { return true; } if (!(obj instanceof CategoryLineAnnotation)) { return false; } CategoryLineAnnotation that = (CategoryLineAnnotation) obj; if (!this.category1.equals(that.getCategory1())) { return false; } if (this.value1 != that.getValue1()) { return false; } if (!this.category2.equals(that.getCategory2())) { return false; } if (this.value2 != that.getValue2()) { return false; } if (!PaintUtilities.equal(this.paint, that.paint)) { return false; } if (!ObjectUtilities.equal(this.stroke, that.stroke)) { return false; } return true;
if (obj == this) { return true; } if (!(obj instanceof DialTextAnnotation)) { return false; } DialTextAnnotation that = (DialTextAnnotation) obj; if (!this.label.equals(that.label)) { return false; } if (!this.font.equals(that.font)) { return false; } if (!PaintUtilities.equal(this.paint, that.paint)) { return false; } if (this.radius != that.radius) { return false; } if (this.angle != that.angle) { return false; } if (!this.anchor.equals(that.anchor)) { return false; } return super.equals(obj);
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/annotations/CategoryLineAnnotation.java File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/dial/DialTextAnnotation.java
Method name: boolean equals(Object) Method name: boolean equals(Object)
Number of AST nodes: 18 Number of AST nodes: 18
1
if (obj == this) {
1
if (obj == this) {
2
            return true;
2
            return true;
3
        }
3
        }
4
        if (!(obj instanceof CategoryLineAnnotation)) {
4
        if (!(obj instanceof DialTextAnnotation)) {
5
            return false;
5
            return false;
6
        }
6
        }
7
        CategoryLineAnnotation that = (CategoryLineAnnotation) obj;
7
        DialTextAnnotation that = (DialTextAnnotation) obj;
8
        if (!this.category1.equals(that.getCategory1())) {
8
        if (!this.label.equals(that.label)) {
9
            return false;
9
            return false;
10
        }
10
        }
11
        if (this.value1 != that.getValue1()) {
11
        if (!this.font.equals(that.font)) {
12
            return false;
12
            return false;
13
        }
13
        }
14
        if (!this.category2.equals(that.getCategory2())) {
14
        if (!PaintUtilities.equal(this.paint, that.paint)) {
15
            return false;
15
            return false;
16
        }
16
        }
17
        if (this.value2 != that.getValue2()) {
17
        if (this.radius != that.radius) {
18
            return false;
18
            return false;
19
        }
19
        }
20
        if (!PaintUtilities.equal(this.paint, that.paint)) {
20
        if (this.angle != that.angle) {
21
            return false;
21
            return false;
22
        }
22
        }
23
        if (!ObjectUtilities.equal(this.stroke, that.stroke)) {
23
        if (!this.anchor.equals(that.anchor)) {
24
            return false;
24
            return false;
25
        }
25
        }
26
        return true;
26
        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.9
Clones locationClones are in different classes
Number of node comparisons101
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements15
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)6.0
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    1
    if (obj == this)
    1
    if (obj == this)
    2
    return true;
    2
    return true;
    3
    if (!(obj instanceof CategoryLineAnnotation))
    3
    if (!(obj instanceof CategoryLineAnnotation))
    3
    if (!(obj instanceof DialTextAnnotation))
    Differences
    Expression1Expression2Difference
    org.jfree.chart.annotations.CategoryLineAnnotationorg.jfree.chart.plot.dial.DialTextAnnotationSUBCLASS_TYPE_MISMATCH
    3
    if (!(obj instanceof DialTextAnnotation))
    4
    return false;
    4
    return false;
    5
    CategoryLineAnnotation that = (CategoryLineAnnotation)obj;
    5
    CategoryLineAnnotation that = (CategoryLineAnnotation)obj;
    5
    DialTextAnnotation that = (DialTextAnnotation)obj;
    Differences
    Expression1Expression2Difference
    org.jfree.chart.annotations.CategoryLineAnnotationorg.jfree.chart.plot.dial.DialTextAnnotationSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.annotations.CategoryLineAnnotationorg.jfree.chart.plot.dial.DialTextAnnotationSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.annotations.CategoryLineAnnotationorg.jfree.chart.plot.dial.DialTextAnnotationSUBCLASS_TYPE_MISMATCH
    5
    DialTextAnnotation that = (DialTextAnnotation)obj;
    6
    if (!this.category1.equals(that.getCategory1()))
    6
    if (!this.category1.equals(that.getCategory1()))
    10
    if (!PaintUtilities.equal(this.paint, that.paint))
    Differences
    Expression1Expression2Difference
    this.category1.equals(that.getCategory1())PaintUtilities.equal(this.paint,that.paint)TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression this.category1.equals(that.getCategory1()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression PaintUtilities.equal(this.paint,that.paint) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10
    if (!PaintUtilities.equal(this.paint, that.paint))
    7
    return false;
    11
    return false;
    8
    if (this.value1 != that.getValue1())
    8
    if (this.value1 != that.getValue1())
    12
    if (this.radius != that.radius)
    Differences
    Expression1Expression2Difference
    value1radiusVARIABLE_NAME_MISMATCH
    that.getValue1()that.radiusTYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression that.getValue1() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.radius cannot be parameterized, because it has dependencies to/from statements that will be extracted
    12
    if (this.radius != that.radius)
    9
    return false;
    13
    return false;
    10
    if (!this.category2.equals(that.getCategory2()))
    10
    if (!this.category2.equals(that.getCategory2()))
    Preondition Violations
    Unmatched statement if(!this.category2.equals(that.getCategory2())) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                                          
    11
    return false;
    11
    return false;
    Preondition Violations
    Unmatched return false;
                                      
    12
    if (this.value2 != that.getValue2())
    12
    if (this.value2 != that.getValue2())
    14
    if (this.angle != that.angle)
    Differences
    Expression1Expression2Difference
    value2angleVARIABLE_NAME_MISMATCH
    that.getValue2()that.angleTYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression that.getValue2() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.angle cannot be parameterized, because it has dependencies to/from statements that will be extracted
    14
    if (this.angle != that.angle)
    13
    return false;
    15
    return false;
    14
    if (!PaintUtilities.equal(this.paint, that.paint))
    14
    if (!PaintUtilities.equal(this.paint, that.paint))
    8
    if (!this.font.equals(that.font))
    Differences
    Expression1Expression2Difference
    PaintUtilities.equal(this.paint,that.paint)this.font.equals(that.font)TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression PaintUtilities.equal(this.paint,that.paint) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression this.font.equals(that.font) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8
    if (!this.font.equals(that.font))
    15
    return false;
    9
    return false;
    16
    if (!ObjectUtilities.equal(this.stroke, that.stroke))
    16
    if (!ObjectUtilities.equal(this.stroke, that.stroke))
    6
    if (!this.label.equals(that.label))
    Differences
    Expression1Expression2Difference
    ObjectUtilities.equal(this.stroke,that.stroke)this.label.equals(that.label)TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression ObjectUtilities.equal(this.stroke,that.stroke) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression this.label.equals(that.label) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6
    if (!this.label.equals(that.label))
    17
    return false;
    7
    return false;
    Precondition Violations (15)
    Row Violation
    1Expression this.category1.equals(that.getCategory1()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression PaintUtilities.equal(this.paint,that.paint) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression that.getValue1() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression that.radius cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Unmatched statement if(!this.category2.equals(that.getCategory2())) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    6Unmatched return false;
    7Expression that.getValue2() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Expression that.angle cannot be parameterized, because it has dependencies to/from statements that will be extracted
    9Expression PaintUtilities.equal(this.paint,that.paint) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10Expression this.font.equals(that.font) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    11Expression ObjectUtilities.equal(this.stroke,that.stroke) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    12Expression this.label.equals(that.label) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    13Clone fragment #1 returns variable that with type org.jfree.chart.annotations.CategoryLineAnnotation , while Clone fragment #2 returns variable that with type org.jfree.chart.plot.dial.DialTextAnnotation
    14Not all possible execution flows end in a return statement
    15The refactoring of the clones is infeasible, because classes org.jfree.chart.annotations.CategoryLineAnnotation and org.jfree.chart.plot.dial.DialTextAnnotation do not have a common superclass