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 MarkerAxisBand)) { return false; } MarkerAxisBand that = (MarkerAxisBand) obj; if (this.topOuterGap != that.topOuterGap) { return false; } if (this.topInnerGap != that.topInnerGap) { return false; } if (this.bottomInnerGap != that.bottomInnerGap) { return false; } if (this.bottomOuterGap != that.bottomOuterGap) { return false; } if (!ObjectUtilities.equal(this.font, that.font)) { return false; } if (!ObjectUtilities.equal(this.markers, that.markers)) { return false; } return true;
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/axis/MarkerAxisBand.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 MarkerAxisBand)) {
5
            return false;   
5
            return false;
6
        }
6
        }
7
        ColorBar that = (ColorBar) obj;
7
        MarkerAxisBand that = (MarkerAxisBand) obj;
8
        if (!this.axis.equals(that.axis)) {
8
        if (this.topOuterGap != that.topOuterGap) {
9
            return false;
9
            return false;
10
        }
10
        }
11
        if (this.colorBarThickness != that.colorBarThickness) {
11
        if (this.topInnerGap != that.topInnerGap) {
12
            return false;
12
            return false;
13
        }
13
        }
14
        if (this.colorBarThicknessPercent != that.colorBarThicknessPercent) {
14
        if (this.bottomInnerGap != that.bottomInnerGap) {
15
            return false;
15
            return false;
16
        }
16
        }
17
        if (!this.colorPalette.equals(that.colorPalette)) {
17
        if (this.bottomOuterGap != that.bottomOuterGap) {
18
            return false;
18
            return false;
19
        }
19
        }
20
        if (this.colorBarLength != that.colorBarLength) {
20
        if (!ObjectUtilities.equal(this.font, that.font)) {
21
            return false;
21
            return false;
22
        }
22
        }
23
        if (this.outerGap != that.outerGap) {
23
        if (!ObjectUtilities.equal(this.markers, that.markers)) {
24
            return false;
24
            return false;
25
        }
25
        }
26
        return true;
26
        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)3.4
Clones locationClones are in different classes
Number of node comparisons119
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements17
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)56.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 ColorBar))
    3
    if (!(obj instanceof ColorBar))
    3
    if (!(obj instanceof MarkerAxisBand))
    Differences
    Expression1Expression2Difference
    org.jfree.chart.axis.ColorBarorg.jfree.chart.axis.MarkerAxisBandVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jfree.chart.axis.ColorBar does not match with type org.jfree.chart.axis.MarkerAxisBand
    • Make classes org.jfree.chart.axis.ColorBar and org.jfree.chart.axis.MarkerAxisBand extend a common superclass
    3
    if (!(obj instanceof MarkerAxisBand))
    4
    return false;
    4
    return false;
                                                                                          
    5
    MarkerAxisBand that = (MarkerAxisBand)obj;
    5
    ColorBar that = (ColorBar)obj;
                                                                  
    6
    if (!this.axis.equals(that.axis))
    6
    if (!this.axis.equals(that.axis))
    14
    if (!ObjectUtilities.equal(this.font, that.font))
    Differences
    Expression1Expression2Difference
    this.axis.equals(that.axis)ObjectUtilities.equal(this.font,that.font)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 ObjectUtilities.equal(this.font,that.font) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    14
    if (!ObjectUtilities.equal(this.font, that.font))
    7
    return false;
    15
    return false;
    8
    if (this.colorBarThickness != that.colorBarThickness)
    8
    if (this.colorBarThickness != that.colorBarThickness)
    8
    if (this.topInnerGap != that.topInnerGap)
    Differences
    Expression1Expression2Difference
    colorBarThicknesstopInnerGapVARIABLE_NAME_MISMATCH
    intdoubleVARIABLE_TYPE_MISMATCH
    org.jfree.chart.axis.ColorBarorg.jfree.chart.axis.MarkerAxisBandVARIABLE_TYPE_MISMATCH
    colorBarThicknesstopInnerGapVARIABLE_NAME_MISMATCH
    intdoubleVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type int of variable this.colorBarThickness does not match with type double of variable this.topInnerGap
    Type int of variable that.colorBarThickness does not match with type double of variable that.topInnerGap
    • Make classes org.jfree.chart.axis.ColorBar and org.jfree.chart.axis.MarkerAxisBand extend a common superclass
    Expression that.colorBarThickness cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.topInnerGap cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type int of variable that.colorBarThickness does not match with type double of variable that.topInnerGap
    8
    if (this.topInnerGap != that.topInnerGap)
    9
    return false;
    9
    return false;
    10
    if (this.colorBarThicknessPercent != that.colorBarThicknessPercent)
    10
    if (this.colorBarThicknessPercent != that.colorBarThicknessPercent)
    10
    if (this.bottomInnerGap != that.bottomInnerGap)
    Differences
    Expression1Expression2Difference
    colorBarThicknessPercentbottomInnerGapVARIABLE_NAME_MISMATCH
    org.jfree.chart.axis.ColorBarorg.jfree.chart.axis.MarkerAxisBandVARIABLE_TYPE_MISMATCH
    colorBarThicknessPercentbottomInnerGapVARIABLE_NAME_MISMATCH
    Preondition Violations
    Type double of variable that.colorBarThicknessPercent does not match with type double of variable that.bottomInnerGap
    • Make classes org.jfree.chart.axis.ColorBar and org.jfree.chart.axis.MarkerAxisBand extend a common superclass
    Expression that.colorBarThicknessPercent cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.bottomInnerGap cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10
    if (this.bottomInnerGap != that.bottomInnerGap)
    11
    return false;
    11
    return false;
    12
    if (!this.colorPalette.equals(that.colorPalette))
    12
    if (!this.colorPalette.equals(that.colorPalette))
    16
    if (!ObjectUtilities.equal(this.markers, that.markers))
    Differences
    Expression1Expression2Difference
    this.colorPalette.equals(that.colorPalette)ObjectUtilities.equal(this.markers,that.markers)TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression this.colorPalette.equals(that.colorPalette) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression ObjectUtilities.equal(this.markers,that.markers) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    16
    if (!ObjectUtilities.equal(this.markers, that.markers))
    13
    return false;
    17
    return false;
    14
    if (this.colorBarLength != that.colorBarLength)
    14
    if (this.colorBarLength != that.colorBarLength)
    12
    if (this.bottomOuterGap != that.bottomOuterGap)
    Differences
    Expression1Expression2Difference
    colorBarLengthbottomOuterGapVARIABLE_NAME_MISMATCH
    intdoubleVARIABLE_TYPE_MISMATCH
    org.jfree.chart.axis.ColorBarorg.jfree.chart.axis.MarkerAxisBandVARIABLE_TYPE_MISMATCH
    colorBarLengthbottomOuterGapVARIABLE_NAME_MISMATCH
    intdoubleVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type int of variable this.colorBarLength does not match with type double of variable this.bottomOuterGap
    Type int of variable that.colorBarLength does not match with type double of variable that.bottomOuterGap
    • Make classes org.jfree.chart.axis.ColorBar and org.jfree.chart.axis.MarkerAxisBand extend a common superclass
    Expression that.colorBarLength cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.bottomOuterGap 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.bottomOuterGap
    12
    if (this.bottomOuterGap != that.bottomOuterGap)
    15
    return false;
    13
    return false;
    16
    if (this.outerGap != that.outerGap)
    16
    if (this.outerGap != that.outerGap)
    6
    if (this.topOuterGap != that.topOuterGap)
    Differences
    Expression1Expression2Difference
    outerGaptopOuterGapVARIABLE_NAME_MISMATCH
    intdoubleVARIABLE_TYPE_MISMATCH
    org.jfree.chart.axis.ColorBarorg.jfree.chart.axis.MarkerAxisBandVARIABLE_TYPE_MISMATCH
    outerGaptopOuterGapVARIABLE_NAME_MISMATCH
    intdoubleVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type int of variable this.outerGap does not match with type double of variable this.topOuterGap
    Type int of variable that.outerGap does not match with type double of variable that.topOuterGap
    • Make classes org.jfree.chart.axis.ColorBar and org.jfree.chart.axis.MarkerAxisBand extend a common superclass
    Expression that.outerGap cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.topOuterGap 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.topOuterGap
    6
    if (this.topOuterGap != that.topOuterGap)
    17
    return false;
    7
    return false;
    18
    return true;
    18
    return true;
    Precondition Violations (23)
    Row Violation
    1Type org.jfree.chart.axis.ColorBar does not match with type org.jfree.chart.axis.MarkerAxisBand
    2Expression this.axis.equals(that.axis) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression ObjectUtilities.equal(this.font,that.font) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Type int of variable this.colorBarThickness does not match with type double of variable this.topInnerGap
    5Type int of variable that.colorBarThickness does not match with type double of variable that.topInnerGap
    6Expression that.colorBarThickness cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression that.topInnerGap cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Type int of variable that.colorBarThickness does not match with type double of variable that.topInnerGap
    9Type double of variable that.colorBarThicknessPercent does not match with type double of variable that.bottomInnerGap
    10Expression that.colorBarThicknessPercent cannot be parameterized, because it has dependencies to/from statements that will be extracted
    11Expression that.bottomInnerGap cannot be parameterized, because it has dependencies to/from statements that will be extracted
    12Expression this.colorPalette.equals(that.colorPalette) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    13Expression ObjectUtilities.equal(this.markers,that.markers) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    14Type int of variable this.colorBarLength does not match with type double of variable this.bottomOuterGap
    15Type int of variable that.colorBarLength does not match with type double of variable that.bottomOuterGap
    16Expression that.colorBarLength cannot be parameterized, because it has dependencies to/from statements that will be extracted
    17Expression that.bottomOuterGap cannot be parameterized, because it has dependencies to/from statements that will be extracted
    18Type int of variable that.colorBarLength does not match with type double of variable that.bottomOuterGap
    19Type int of variable this.outerGap does not match with type double of variable this.topOuterGap
    20Type int of variable that.outerGap does not match with type double of variable that.topOuterGap
    21Expression that.outerGap cannot be parameterized, because it has dependencies to/from statements that will be extracted
    22Expression that.topOuterGap cannot be parameterized, because it has dependencies to/from statements that will be extracted
    23Type int of variable that.outerGap does not match with type double of variable that.topOuterGap