if (obj == this) { return true; } if (!(obj instanceof CategoryLabelPosition)) { return false; } CategoryLabelPosition that = (CategoryLabelPosition) obj; if (!this.categoryAnchor.equals(that.categoryAnchor)) { return false; } if (!this.labelAnchor.equals(that.labelAnchor)) { return false; } if (!this.rotationAnchor.equals(that.rotationAnchor)) { return false; } if (this.angle != that.angle) { return false; } if (this.widthType != that.widthType) { return false; } if (this.widthRatio != that.widthRatio) { return false; } return true;
if (obj == this) { return true; } if (!(obj instanceof StandardDialRange)) { return false; } StandardDialRange that = (StandardDialRange) obj; if (this.scaleIndex != that.scaleIndex) { return false; } if (this.lowerBound != that.lowerBound) { return false; } if (this.upperBound != that.upperBound) { return false; } if (!PaintUtilities.equal(this.paint, that.paint)) { return false; } if (this.innerRadius != that.innerRadius) { return false; } if (this.outerRadius != that.outerRadius) { return false; } return super.equals(obj);
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/axis/CategoryLabelPosition.java File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/dial/StandardDialRange.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 CategoryLabelPosition)) {
4
        if (!(obj instanceof StandardDialRange)) {
5
            return false;
5
            return false;
6
        }
6
        }
7
        CategoryLabelPosition that = (CategoryLabelPosition) obj;
7
        StandardDialRange that = (StandardDialRange) obj;
8
        if (!this.categoryAnchor.equals(that.categoryAnchor)) {
8
        if (this.scaleIndex != that.scaleIndex) {
9
            return false;
9
            return false;
10
        }
10
        }
11
        if (!this.labelAnchor.equals(that.labelAnchor)) {
11
        if (this.lowerBound != that.lowerBound) {
12
            return false;
12
            return false;
13
        }
13
        }
14
        if (!this.rotationAnchor.equals(that.rotationAnchor)) {
14
        if (this.upperBound != that.upperBound) {
15
            return false;
15
            return false;
16
        }
16
        }
17
        if (this.angle != that.angle) {
17
        if (!PaintUtilities.equal(this.paint, that.paint)) {
18
            return false;
18
            return false;
19
        }
19
        }
20
        if (this.widthType != that.widthType) {
20
        if (this.innerRadius != that.innerRadius) {
21
            return false;
21
            return false;
22
        }
22
        }
23
        if (this.widthRatio != that.widthRatio) {
23
        if (this.outerRadius != that.outerRadius) {
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)3.7
Clones locationClones are in different classes
Number of node comparisons95
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements12
    Number of unmapped statements in the first code fragment5
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)4.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 CategoryLabelPosition))
    3
    if (!(obj instanceof CategoryLabelPosition))
    3
    if (!(obj instanceof StandardDialRange))
    Differences
    Expression1Expression2Difference
    org.jfree.chart.axis.CategoryLabelPositionorg.jfree.chart.plot.dial.StandardDialRangeVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jfree.chart.axis.CategoryLabelPosition does not match with type org.jfree.chart.plot.dial.StandardDialRange
    • Make classes org.jfree.chart.axis.CategoryLabelPosition and org.jfree.chart.plot.dial.StandardDialRange extend a common superclass
    3
    if (!(obj instanceof StandardDialRange))
    4
    return false;
    4
    return false;
                                                                                                      
    5
    StandardDialRange that = (StandardDialRange)obj;
    5
    CategoryLabelPosition that = (CategoryLabelPosition)obj;
                                                                                                                      
    6
    if (!this.categoryAnchor.equals(that.categoryAnchor))
    6
    if (!this.categoryAnchor.equals(that.categoryAnchor))
    12
    if (!PaintUtilities.equal(this.paint, that.paint))
    Differences
    Expression1Expression2Difference
    this.categoryAnchor.equals(that.categoryAnchor)PaintUtilities.equal(this.paint,that.paint)TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression this.categoryAnchor.equals(that.categoryAnchor) 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
    12
    if (!PaintUtilities.equal(this.paint, that.paint))
    7
    return false;
    13
    return false;
    8
    if (!this.labelAnchor.equals(that.labelAnchor))
                                                                                                      
    9
    return false;
    9
    return false;
    Preondition Violations
    Unmatched return false;
                                    
    10
    if (!this.rotationAnchor.equals(that.rotationAnchor))
                                                                                                                    
    11
    return false;
    11
    return false;
    Preondition Violations
    Unmatched return false;
                                      
    12
    if (this.angle != that.angle)
    12
    if (this.angle != that.angle)
    10
    if (this.upperBound != that.upperBound)
    Differences
    Expression1Expression2Difference
    angleupperBoundVARIABLE_NAME_MISMATCH
    org.jfree.chart.axis.CategoryLabelPositionorg.jfree.chart.plot.dial.StandardDialRangeVARIABLE_TYPE_MISMATCH
    angleupperBoundVARIABLE_NAME_MISMATCH
    Preondition Violations
    Type double of variable that.angle does not match with type double of variable that.upperBound
    • Make classes org.jfree.chart.axis.CategoryLabelPosition and org.jfree.chart.plot.dial.StandardDialRange extend a common superclass
    Expression that.angle cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.upperBound cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10
    if (this.upperBound != that.upperBound)
    13
    return false;
    11
    return false;
    14
    if (this.widthType != that.widthType)
    14
    if (this.widthType != that.widthType)
    8
    if (this.lowerBound != that.lowerBound)
    Differences
    Expression1Expression2Difference
    widthTypelowerBoundVARIABLE_NAME_MISMATCH
    org.jfree.chart.axis.CategoryLabelWidthTypedoubleVARIABLE_TYPE_MISMATCH
    org.jfree.chart.axis.CategoryLabelPositionorg.jfree.chart.plot.dial.StandardDialRangeVARIABLE_TYPE_MISMATCH
    widthTypelowerBoundVARIABLE_NAME_MISMATCH
    org.jfree.chart.axis.CategoryLabelWidthTypedoubleVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jfree.chart.axis.CategoryLabelWidthType of variable this.widthType does not match with type double of variable this.lowerBound
    Type org.jfree.chart.axis.CategoryLabelWidthType of variable that.widthType does not match with type double of variable that.lowerBound
    • Make classes org.jfree.chart.axis.CategoryLabelPosition and org.jfree.chart.plot.dial.StandardDialRange extend a common superclass
    Expression that.widthType cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.lowerBound cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type org.jfree.chart.axis.CategoryLabelWidthType of variable that.widthType does not match with type double of variable that.lowerBound
    8
    if (this.lowerBound != that.lowerBound)
    15
    return false;
    9
    return false;
    16
    if (this.widthRatio != that.widthRatio)
    16
    if (this.widthRatio != that.widthRatio)
    6
    if (this.scaleIndex != that.scaleIndex)
    Differences
    Expression1Expression2Difference
    widthRatioscaleIndexVARIABLE_NAME_MISMATCH
    floatintVARIABLE_TYPE_MISMATCH
    org.jfree.chart.axis.CategoryLabelPositionorg.jfree.chart.plot.dial.StandardDialRangeVARIABLE_TYPE_MISMATCH
    widthRatioscaleIndexVARIABLE_NAME_MISMATCH
    floatintVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type float of variable this.widthRatio does not match with type int of variable this.scaleIndex
    Type float of variable that.widthRatio does not match with type int of variable that.scaleIndex
    • Make classes org.jfree.chart.axis.CategoryLabelPosition and org.jfree.chart.plot.dial.StandardDialRange extend a common superclass
    Expression that.widthRatio cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.scaleIndex cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type float of variable that.widthRatio does not match with type int of variable that.scaleIndex
    6
    if (this.scaleIndex != that.scaleIndex)
    17
    return false;
    7
    return false;
    Precondition Violations (20)
    Row Violation
    1Type org.jfree.chart.axis.CategoryLabelPosition does not match with type org.jfree.chart.plot.dial.StandardDialRange
    2Expression this.categoryAnchor.equals(that.categoryAnchor) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression PaintUtilities.equal(this.paint,that.paint) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Unmatched return false;
    5Unmatched return false;
    6Type double of variable that.angle does not match with type double of variable that.upperBound
    7Expression that.angle cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Expression that.upperBound cannot be parameterized, because it has dependencies to/from statements that will be extracted
    9Type org.jfree.chart.axis.CategoryLabelWidthType of variable this.widthType does not match with type double of variable this.lowerBound
    10Type org.jfree.chart.axis.CategoryLabelWidthType of variable that.widthType does not match with type double of variable that.lowerBound
    11Expression that.widthType cannot be parameterized, because it has dependencies to/from statements that will be extracted
    12Expression that.lowerBound cannot be parameterized, because it has dependencies to/from statements that will be extracted
    13Type org.jfree.chart.axis.CategoryLabelWidthType of variable that.widthType does not match with type double of variable that.lowerBound
    14Type float of variable this.widthRatio does not match with type int of variable this.scaleIndex
    15Type float of variable that.widthRatio does not match with type int of variable that.scaleIndex
    16Expression that.widthRatio cannot be parameterized, because it has dependencies to/from statements that will be extracted
    17Expression that.scaleIndex cannot be parameterized, because it has dependencies to/from statements that will be extracted
    18Type float of variable that.widthRatio does not match with type int of variable that.scaleIndex
    19Not all possible execution flows end in a return statement
    20The refactoring of the clones is infeasible, because classes org.jfree.chart.axis.CategoryLabelPosition and org.jfree.chart.plot.dial.StandardDialRange do not have a common superclass