if (obj == this) { return true; } if (!(obj instanceof ColorBar)) { return false; } ColorBar that = (ColorBar) obj; if (!this.axis.equals(that.axis)) { return false; } if (this.colorBarThickness != that.colorBarThickness) { return false; } if (this.colorBarThicknessPercent != that.colorBarThicknessPercent) { return false; } if (!this.colorPalette.equals(that.colorPalette)) { return false; } if (this.colorBarLength != that.colorBarLength) { return false; } if (this.outerGap != that.outerGap) { 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/ColorBar.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 ColorBar)) {
4
        if (!(obj instanceof StandardDialRange)) {
5
            return false;   
5
            return false;
6
        }
6
        }
7
        ColorBar that = (ColorBar) obj;
7
        StandardDialRange that = (StandardDialRange) obj;
8
        if (!this.axis.equals(that.axis)) {
8
        if (this.scaleIndex != that.scaleIndex) {
9
            return false;
9
            return false;
10
        }
10
        }
11
        if (this.colorBarThickness != that.colorBarThickness) {
11
        if (this.lowerBound != that.lowerBound) {
12
            return false;
12
            return false;
13
        }
13
        }
14
        if (this.colorBarThicknessPercent != that.colorBarThicknessPercent) {
14
        if (this.upperBound != that.upperBound) {
15
            return false;
15
            return false;
16
        }
16
        }
17
        if (!this.colorPalette.equals(that.colorPalette)) {
17
        if (!PaintUtilities.equal(this.paint, that.paint)) {
18
            return false;
18
            return false;
19
        }
19
        }
20
        if (this.colorBarLength != that.colorBarLength) {
20
        if (this.innerRadius != that.innerRadius) {
21
            return false;
21
            return false;
22
        }
22
        }
23
        if (this.outerGap != that.outerGap) {
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)4.6
Clones locationClones are in different classes
Number of node comparisons107
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements14
    Number of unmapped statements in the first code fragment3
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)40.4
    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 ColorBar))
    3
    if (!(obj instanceof ColorBar))
    3
    if (!(obj instanceof StandardDialRange))
    Differences
    Expression1Expression2Difference
    org.jfree.chart.axis.ColorBarorg.jfree.chart.plot.dial.StandardDialRangeVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jfree.chart.axis.ColorBar does not match with type org.jfree.chart.plot.dial.StandardDialRange
    • Make classes org.jfree.chart.axis.ColorBar 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
    ColorBar that = (ColorBar)obj;
                                                                  
    6
    if (!this.axis.equals(that.axis))
    6
    if (!this.axis.equals(that.axis))
    12
    if (!PaintUtilities.equal(this.paint, that.paint))
    Differences
    Expression1Expression2Difference
    this.axis.equals(that.axis)PaintUtilities.equal(this.paint,that.paint)TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression this.axis.equals(that.axis) 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.colorBarThickness != that.colorBarThickness)
    8
    if (this.colorBarThickness != that.colorBarThickness)
    6
    if (this.scaleIndex != that.scaleIndex)
    Differences
    Expression1Expression2Difference
    colorBarThicknessscaleIndexVARIABLE_NAME_MISMATCH
    org.jfree.chart.axis.ColorBarorg.jfree.chart.plot.dial.StandardDialRangeVARIABLE_TYPE_MISMATCH
    colorBarThicknessscaleIndexVARIABLE_NAME_MISMATCH
    Preondition Violations
    Type int of variable that.colorBarThickness does not match with type int of variable that.scaleIndex
    • Make classes org.jfree.chart.axis.ColorBar and org.jfree.chart.plot.dial.StandardDialRange extend a common superclass
    Expression that.colorBarThickness 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
    6
    if (this.scaleIndex != that.scaleIndex)
    9
    return false;
    7
    return false;
    10
    if (this.colorBarThicknessPercent != that.colorBarThicknessPercent)
    10
    if (this.colorBarThicknessPercent != that.colorBarThicknessPercent)
    10
    if (this.upperBound != that.upperBound)
    Differences
    Expression1Expression2Difference
    colorBarThicknessPercentupperBoundVARIABLE_NAME_MISMATCH
    org.jfree.chart.axis.ColorBarorg.jfree.chart.plot.dial.StandardDialRangeVARIABLE_TYPE_MISMATCH
    colorBarThicknessPercentupperBoundVARIABLE_NAME_MISMATCH
    Preondition Violations
    Type double of variable that.colorBarThicknessPercent does not match with type double of variable that.upperBound
    • Make classes org.jfree.chart.axis.ColorBar and org.jfree.chart.plot.dial.StandardDialRange extend a common superclass
    Expression that.colorBarThicknessPercent 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)
    11
    return false;
    11
    return false;
    12
    if (!this.colorPalette.equals(that.colorPalette))
                                                                                                            
    13
    return false;
    13
    return false;
    Preondition Violations
    Unmatched return false;
                                      
    14
    if (this.colorBarLength != that.colorBarLength)
    14
    if (this.colorBarLength != that.colorBarLength)
    14
    if (this.innerRadius != that.innerRadius)
    Differences
    Expression1Expression2Difference
    colorBarLengthinnerRadiusVARIABLE_NAME_MISMATCH
    intdoubleVARIABLE_TYPE_MISMATCH
    org.jfree.chart.axis.ColorBarorg.jfree.chart.plot.dial.StandardDialRangeVARIABLE_TYPE_MISMATCH
    colorBarLengthinnerRadiusVARIABLE_NAME_MISMATCH
    intdoubleVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type int of variable this.colorBarLength does not match with type double of variable this.innerRadius
    Type int of variable that.colorBarLength does not match with type double of variable that.innerRadius
    • Make classes org.jfree.chart.axis.ColorBar and org.jfree.chart.plot.dial.StandardDialRange extend a common superclass
    Expression that.colorBarLength cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.innerRadius cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type int of variable that.colorBarLength does not match with type double of variable that.innerRadius
    14
    if (this.innerRadius != that.innerRadius)
    15
    return false;
    15
    return false;
    16
    if (this.outerGap != that.outerGap)
    16
    if (this.outerGap != that.outerGap)
    8
    if (this.lowerBound != that.lowerBound)
    Differences
    Expression1Expression2Difference
    outerGaplowerBoundVARIABLE_NAME_MISMATCH
    intdoubleVARIABLE_TYPE_MISMATCH
    org.jfree.chart.axis.ColorBarorg.jfree.chart.plot.dial.StandardDialRangeVARIABLE_TYPE_MISMATCH
    outerGaplowerBoundVARIABLE_NAME_MISMATCH
    intdoubleVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type int of variable this.outerGap does not match with type double of variable this.lowerBound
    Type int of variable that.outerGap does not match with type double of variable that.lowerBound
    • Make classes org.jfree.chart.axis.ColorBar and org.jfree.chart.plot.dial.StandardDialRange extend a common superclass
    Expression that.outerGap 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 int of variable that.outerGap does not match with type double of variable that.lowerBound
    8
    if (this.lowerBound != that.lowerBound)
    17
    return false;
    9
    return false;
    Precondition Violations (22)
    Row Violation
    1Type org.jfree.chart.axis.ColorBar does not match with type org.jfree.chart.plot.dial.StandardDialRange
    2Expression this.axis.equals(that.axis) 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
    4Type int of variable that.colorBarThickness does not match with type int of variable that.scaleIndex
    5Expression that.colorBarThickness cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression that.scaleIndex cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Type double of variable that.colorBarThicknessPercent does not match with type double of variable that.upperBound
    8Expression that.colorBarThicknessPercent cannot be parameterized, because it has dependencies to/from statements that will be extracted
    9Expression that.upperBound cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10Unmatched return false;
    11Type int of variable this.colorBarLength does not match with type double of variable this.innerRadius
    12Type int of variable that.colorBarLength does not match with type double of variable that.innerRadius
    13Expression that.colorBarLength cannot be parameterized, because it has dependencies to/from statements that will be extracted
    14Expression that.innerRadius cannot be parameterized, because it has dependencies to/from statements that will be extracted
    15Type int of variable that.colorBarLength does not match with type double of variable that.innerRadius
    16Type int of variable this.outerGap does not match with type double of variable this.lowerBound
    17Type int of variable that.outerGap does not match with type double of variable that.lowerBound
    18Expression that.outerGap cannot be parameterized, because it has dependencies to/from statements that will be extracted
    19Expression that.lowerBound cannot be parameterized, because it has dependencies to/from statements that will be extracted
    20Type int of variable that.outerGap does not match with type double of variable that.lowerBound
    21Not all possible execution flows end in a return statement
    22The refactoring of the clones is infeasible, because classes org.jfree.chart.axis.ColorBar and org.jfree.chart.plot.dial.StandardDialRange do not have a common superclass