if (obj == this) { return true; } if (!(obj instanceof CategoryItemEntity)) { return false; } CategoryItemEntity that = (CategoryItemEntity) obj; if (!this.rowKey.equals(that.rowKey)) { return false; } if (!this.columnKey.equals(that.columnKey)) { return false; } if (!ObjectUtilities.equal(this.dataset, that.dataset)) { return false; } // check the deprecated fields if (this.categoryIndex != that.categoryIndex) { return false; } if (this.series != that.series) { return false; } if (!ObjectUtilities.equal(this.category, that.category)) { return false; } return super.equals(obj);
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/entity/CategoryItemEntity.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 CategoryItemEntity)) {
4
        if (!(obj instanceof DialTextAnnotation)) {
5
            return false;
5
            return false;
6
        }
6
        }
7
        CategoryItemEntity that = (CategoryItemEntity) obj;
7
        DialTextAnnotation that = (DialTextAnnotation) obj;
8
        if (!this.rowKey.equals(that.rowKey)) {
8
        if (!this.label.equals(that.label)) {
9
            return false;
9
            return false;
10
        }
10
        }
11
        if (!this.columnKey.equals(that.columnKey)) {
11
        if (!this.font.equals(that.font)) {
12
            return false;
12
            return false;
13
        }
13
        }
14
        if (!ObjectUtilities.equal(this.dataset, that.dataset)) {
14
        if (!PaintUtilities.equal(this.paint, that.paint)) {
15
            return false;
15
            return false;
16
        }
16
        }
17
        
17
        
18
        // check the deprecated fields
19
        if (this.categoryIndex != that.categoryIndex) {
18
if (this.radius != that.radius) {
20
            return false;   
19
            return false;
21
        }
20
        }
22
        if (this.series != that.series) {
21
        if (this.angle != that.angle) {
23
            return false;   
22
            return false;
24
        }
23
        }
25
        if (!ObjectUtilities.equal(this.category, that.category)) {
24
        if (!this.anchor.equals(that.anchor)) {
26
            return false;   
25
            return false;
27
        }
26
        }
28
        return super.equals(obj);
27
        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)5.2
Clones locationClones are in different classes
Number of node comparisons125
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements18
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)6.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 CategoryItemEntity))
    3
    if (!(obj instanceof CategoryItemEntity))
    3
    if (!(obj instanceof DialTextAnnotation))
    Differences
    Expression1Expression2Difference
    org.jfree.chart.entity.CategoryItemEntityorg.jfree.chart.plot.dial.DialTextAnnotationSUBCLASS_TYPE_MISMATCH
    3
    if (!(obj instanceof DialTextAnnotation))
    4
    return false;
    4
    return false;
    5
    CategoryItemEntity that = (CategoryItemEntity)obj;
    5
    CategoryItemEntity that = (CategoryItemEntity)obj;
    5
    DialTextAnnotation that = (DialTextAnnotation)obj;
    Differences
    Expression1Expression2Difference
    org.jfree.chart.entity.CategoryItemEntityorg.jfree.chart.plot.dial.DialTextAnnotationSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.entity.CategoryItemEntityorg.jfree.chart.plot.dial.DialTextAnnotationSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.entity.CategoryItemEntityorg.jfree.chart.plot.dial.DialTextAnnotationSUBCLASS_TYPE_MISMATCH
    5
    DialTextAnnotation that = (DialTextAnnotation)obj;
    6
    if (!this.rowKey.equals(that.rowKey))
    6
    if (!this.rowKey.equals(that.rowKey))
    6
    if (!this.label.equals(that.label))
    Differences
    Expression1Expression2Difference
    org.jfree.chart.entity.CategoryItemEntityorg.jfree.chart.plot.dial.DialTextAnnotationSUBCLASS_TYPE_MISMATCH
    rowKeylabelVARIABLE_NAME_MISMATCH
    java.lang.Comparablejava.lang.StringVARIABLE_TYPE_MISMATCH
    rowKeylabelVARIABLE_NAME_MISMATCH
    java.lang.Comparablejava.lang.StringVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Expression that.rowKey cannot be unified with expression that.label , because common superclass type java.lang.Comparable cannot be passed as an argument to public boolean equals(java.lang.Object)
    Expression that.rowKey cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.label cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type java.lang.Comparable of variable that.rowKey does not match with type java.lang.String of variable that.label
    • Make classes java.lang.Comparable and java.lang.String extend a common superclass
    Type java.lang.Comparable of variable this.rowKey does not match with type java.lang.String of variable this.label
    • Make classes java.lang.Comparable and java.lang.String extend a common superclass
    6
    if (!this.label.equals(that.label))
    7
    return false;
    7
    return false;
    8
    if (!this.columnKey.equals(that.columnKey))
    8
    if (!this.columnKey.equals(that.columnKey))
    8
    if (!this.font.equals(that.font))
    Differences
    Expression1Expression2Difference
    org.jfree.chart.entity.CategoryItemEntityorg.jfree.chart.plot.dial.DialTextAnnotationSUBCLASS_TYPE_MISMATCH
    columnKeyfontVARIABLE_NAME_MISMATCH
    java.lang.Comparablejava.awt.FontVARIABLE_TYPE_MISMATCH
    columnKeyfontVARIABLE_NAME_MISMATCH
    java.lang.Comparablejava.awt.FontVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Expression that.columnKey cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.font cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type java.lang.Comparable of variable that.columnKey does not match with type java.awt.Font of variable that.font
    • Make classes java.lang.Comparable and java.awt.Font extend a common superclass
    Type java.lang.Comparable of variable this.columnKey does not match with type java.awt.Font of variable this.font
    • Make classes java.lang.Comparable and java.awt.Font extend a common superclass
    8
    if (!this.font.equals(that.font))
    9
    return false;
    9
    return false;
    10
    if (!ObjectUtilities.equal(this.dataset, that.dataset))
    10
    if (!ObjectUtilities.equal(this.dataset, that.dataset))
    10
    if (!PaintUtilities.equal(this.paint, that.paint))
    Differences
    Expression1Expression2Difference
    datasetpaintVARIABLE_NAME_MISMATCH
    org.jfree.data.category.CategoryDatasetjava.awt.PaintVARIABLE_TYPE_MISMATCH
    org.jfree.chart.entity.CategoryItemEntityorg.jfree.chart.plot.dial.DialTextAnnotationSUBCLASS_TYPE_MISMATCH
    datasetpaintVARIABLE_NAME_MISMATCH
    org.jfree.data.category.CategoryDatasetjava.awt.PaintVARIABLE_TYPE_MISMATCH
    org.jfree.util.ObjectUtilitiesorg.jfree.util.PaintUtilitiesVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jfree.data.category.CategoryDataset of variable this.dataset does not match with type java.awt.Paint of variable this.paint
    • Make classes org.jfree.data.category.CategoryDataset and java.awt.Paint extend a common superclass
    Expression that.dataset cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.paint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type org.jfree.data.category.CategoryDataset of variable that.dataset does not match with type java.awt.Paint of variable that.paint
    • Make classes org.jfree.data.category.CategoryDataset and java.awt.Paint extend a common superclass
    Type org.jfree.util.ObjectUtilities does not match with type org.jfree.util.PaintUtilities
    • Make classes org.jfree.util.ObjectUtilities and org.jfree.util.PaintUtilities extend a common superclass
    10
    if (!PaintUtilities.equal(this.paint, that.paint))
    11
    return false;
    11
    return false;
    12
    if (this.categoryIndex != that.categoryIndex)
    12
    if (this.categoryIndex != that.categoryIndex)
    12
    if (this.radius != that.radius)
    Differences
    Expression1Expression2Difference
    categoryIndexradiusVARIABLE_NAME_MISMATCH
    intdoubleVARIABLE_TYPE_MISMATCH
    org.jfree.chart.entity.CategoryItemEntityorg.jfree.chart.plot.dial.DialTextAnnotationSUBCLASS_TYPE_MISMATCH
    categoryIndexradiusVARIABLE_NAME_MISMATCH
    intdoubleVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type int of variable this.categoryIndex does not match with type double of variable this.radius
    Expression that.categoryIndex 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
    Type int of variable that.categoryIndex does not match with type double of variable that.radius
    12
    if (this.radius != that.radius)
    13
    return false;
    13
    return false;
    14
    if (this.series != that.series)
    14
    if (this.series != that.series)
    14
    if (this.angle != that.angle)
    Differences
    Expression1Expression2Difference
    seriesangleVARIABLE_NAME_MISMATCH
    intdoubleVARIABLE_TYPE_MISMATCH
    org.jfree.chart.entity.CategoryItemEntityorg.jfree.chart.plot.dial.DialTextAnnotationSUBCLASS_TYPE_MISMATCH
    seriesangleVARIABLE_NAME_MISMATCH
    intdoubleVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type int of variable this.series does not match with type double of variable this.angle
    Expression that.series 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
    Type int of variable that.series does not match with type double of variable that.angle
    14
    if (this.angle != that.angle)
    15
    return false;
    15
    return false;
    16
    if (!ObjectUtilities.equal(this.category, that.category))
    16
    if (!ObjectUtilities.equal(this.category, that.category))
    16
    if (!this.anchor.equals(that.anchor))
    Differences
    Expression1Expression2Difference
    ObjectUtilities.equal(this.category,that.category)this.anchor.equals(that.anchor)TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression ObjectUtilities.equal(this.category,that.category) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression this.anchor.equals(that.anchor) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    16
    if (!this.anchor.equals(that.anchor))
    17
    return false;
    17
    return false;
    18
    return super.equals(obj);
    18
    return super.equals(obj);
    18
    return super.equals(obj);
    Preondition Violations
    Super method call return super.equals(obj); cannot be extracted from method
    Super method call return super.equals(obj); cannot be extracted from method
    18
    return super.equals(obj);
    Precondition Violations (27)
    Row Violation
    1Expression that.rowKey cannot be unified with expression that.label , because common superclass type java.lang.Comparable cannot be passed as an argument to public boolean equals(java.lang.Object)
    2Expression that.rowKey cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression that.label cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Type java.lang.Comparable of variable that.rowKey does not match with type java.lang.String of variable that.label
    5Type java.lang.Comparable of variable this.rowKey does not match with type java.lang.String of variable this.label
    6Expression that.columnKey cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression that.font cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Type java.lang.Comparable of variable that.columnKey does not match with type java.awt.Font of variable that.font
    9Type java.lang.Comparable of variable this.columnKey does not match with type java.awt.Font of variable this.font
    10Type org.jfree.data.category.CategoryDataset of variable this.dataset does not match with type java.awt.Paint of variable this.paint
    11Expression that.dataset cannot be parameterized, because it has dependencies to/from statements that will be extracted
    12Expression that.paint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    13Type org.jfree.data.category.CategoryDataset of variable that.dataset does not match with type java.awt.Paint of variable that.paint
    14Type org.jfree.util.ObjectUtilities does not match with type org.jfree.util.PaintUtilities
    15Type int of variable this.categoryIndex does not match with type double of variable this.radius
    16Expression that.categoryIndex cannot be parameterized, because it has dependencies to/from statements that will be extracted
    17Expression that.radius cannot be parameterized, because it has dependencies to/from statements that will be extracted
    18Type int of variable that.categoryIndex does not match with type double of variable that.radius
    19Type int of variable this.series does not match with type double of variable this.angle
    20Expression that.series cannot be parameterized, because it has dependencies to/from statements that will be extracted
    21Expression that.angle cannot be parameterized, because it has dependencies to/from statements that will be extracted
    22Type int of variable that.series does not match with type double of variable that.angle
    23Expression ObjectUtilities.equal(this.category,that.category) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    24Expression this.anchor.equals(that.anchor) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    25Super method call return super.equals(obj); cannot be extracted from method
    26Super method call return super.equals(obj); cannot be extracted from method
    27The refactoring of the clones is infeasible, because classes org.jfree.chart.entity.CategoryItemEntity and org.jfree.chart.plot.dial.DialTextAnnotation do not have a common superclass