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 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;
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/axis/ColorBar.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 ColorBar)) {
5
            return false;
5
            return false;   
6
        }
6
        }
7
        CategoryLabelPosition that = (CategoryLabelPosition) obj;
7
        ColorBar that = (ColorBar) obj;
8
        if (!this.categoryAnchor.equals(that.categoryAnchor)) {
8
        if (!this.axis.equals(that.axis)) {
9
            return false;
9
            return false;
10
        }
10
        }
11
        if (!this.labelAnchor.equals(that.labelAnchor)) {
11
        if (this.colorBarThickness != that.colorBarThickness) {
12
            return false;
12
            return false;
13
        }
13
        }
14
        if (!this.rotationAnchor.equals(that.rotationAnchor)) {
14
        if (this.colorBarThicknessPercent != that.colorBarThicknessPercent) {
15
            return false;
15
            return false;
16
        }
16
        }
17
        if (this.angle != that.angle) {
17
        if (!this.colorPalette.equals(that.colorPalette)) {
18
            return false;
18
            return false;
19
        }
19
        }
20
        if (this.widthType != that.widthType) {
20
        if (this.colorBarLength != that.colorBarLength) {
21
            return false;
21
            return false;
22
        }
22
        }
23
        if (this.widthRatio != that.widthRatio) {
23
        if (this.outerGap != that.outerGap) {
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.9
Clones locationClones are in different classes
Number of node comparisons104
  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)4.9
    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 ColorBar))
    Differences
    Expression1Expression2Difference
    org.jfree.chart.axis.CategoryLabelPositionorg.jfree.chart.axis.ColorBarVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jfree.chart.axis.CategoryLabelPosition does not match with type org.jfree.chart.axis.ColorBar
    • Make classes org.jfree.chart.axis.CategoryLabelPosition and org.jfree.chart.axis.ColorBar extend a common superclass
    3
    if (!(obj instanceof ColorBar))
    4
    return false;
    4
    return false;
                                                                  
    5
    ColorBar that = (ColorBar)obj;
    5
    CategoryLabelPosition that = (CategoryLabelPosition)obj;
                                                                                                                      
    6
    if (!this.categoryAnchor.equals(that.categoryAnchor))
    6
    if (!this.categoryAnchor.equals(that.categoryAnchor))
    6
    if (!this.axis.equals(that.axis))
    Differences
    Expression1Expression2Difference
    org.jfree.chart.axis.CategoryLabelPositionorg.jfree.chart.axis.ColorBarVARIABLE_TYPE_MISMATCH
    categoryAnchoraxisVARIABLE_NAME_MISMATCH
    org.jfree.ui.RectangleAnchororg.jfree.chart.axis.ValueAxisVARIABLE_TYPE_MISMATCH
    categoryAnchoraxisVARIABLE_NAME_MISMATCH
    org.jfree.ui.RectangleAnchororg.jfree.chart.axis.ValueAxisVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jfree.ui.RectangleAnchor of variable that.categoryAnchor does not match with type org.jfree.chart.axis.ValueAxis of variable that.axis
    • Make classes org.jfree.chart.axis.CategoryLabelPosition and org.jfree.chart.axis.ColorBar extend a common superclass
    Expression that.categoryAnchor cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.axis cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type org.jfree.ui.RectangleAnchor of variable that.categoryAnchor does not match with type org.jfree.chart.axis.ValueAxis of variable that.axis
    • Make classes org.jfree.ui.RectangleAnchor and org.jfree.chart.axis.ValueAxis extend a common superclass
    Type org.jfree.ui.RectangleAnchor of variable this.categoryAnchor does not match with type org.jfree.chart.axis.ValueAxis of variable this.axis
    • Make classes org.jfree.ui.RectangleAnchor and org.jfree.chart.axis.ValueAxis extend a common superclass
    6
    if (!this.axis.equals(that.axis))
    7
    return false;
    7
    return false;
    8
    if (!this.labelAnchor.equals(that.labelAnchor))
    8
    if (!this.labelAnchor.equals(that.labelAnchor))
    12
    if (!this.colorPalette.equals(that.colorPalette))
    Differences
    Expression1Expression2Difference
    org.jfree.chart.axis.CategoryLabelPositionorg.jfree.chart.axis.ColorBarVARIABLE_TYPE_MISMATCH
    labelAnchorcolorPaletteVARIABLE_NAME_MISMATCH
    org.jfree.text.TextBlockAnchororg.jfree.chart.plot.ColorPaletteVARIABLE_TYPE_MISMATCH
    labelAnchorcolorPaletteVARIABLE_NAME_MISMATCH
    org.jfree.text.TextBlockAnchororg.jfree.chart.plot.ColorPaletteVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jfree.text.TextBlockAnchor of variable that.labelAnchor does not match with type org.jfree.chart.plot.ColorPalette of variable that.colorPalette
    • Make classes org.jfree.chart.axis.CategoryLabelPosition and org.jfree.chart.axis.ColorBar extend a common superclass
    Expression that.labelAnchor cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.colorPalette cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type org.jfree.text.TextBlockAnchor of variable that.labelAnchor does not match with type org.jfree.chart.plot.ColorPalette of variable that.colorPalette
    • Make classes org.jfree.text.TextBlockAnchor and org.jfree.chart.plot.ColorPalette extend a common superclass
    Type org.jfree.text.TextBlockAnchor of variable this.labelAnchor does not match with type org.jfree.chart.plot.ColorPalette of variable this.colorPalette
    • Make classes org.jfree.text.TextBlockAnchor and org.jfree.chart.plot.ColorPalette extend a common superclass
    12
    if (!this.colorPalette.equals(that.colorPalette))
    9
    return false;
    13
    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.colorBarThicknessPercent != that.colorBarThicknessPercent)
    Differences
    Expression1Expression2Difference
    anglecolorBarThicknessPercentVARIABLE_NAME_MISMATCH
    org.jfree.chart.axis.CategoryLabelPositionorg.jfree.chart.axis.ColorBarVARIABLE_TYPE_MISMATCH
    anglecolorBarThicknessPercentVARIABLE_NAME_MISMATCH
    Preondition Violations
    Type double of variable that.angle does not match with type double of variable that.colorBarThicknessPercent
    • Make classes org.jfree.chart.axis.CategoryLabelPosition and org.jfree.chart.axis.ColorBar extend a common superclass
    Expression that.angle cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.colorBarThicknessPercent cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10
    if (this.colorBarThicknessPercent != that.colorBarThicknessPercent)
    13
    return false;
    11
    return false;
    14
    if (this.widthType != that.widthType)
    14
    if (this.widthType != that.widthType)
    14
    if (this.colorBarLength != that.colorBarLength)
    Differences
    Expression1Expression2Difference
    widthTypecolorBarLengthVARIABLE_NAME_MISMATCH
    org.jfree.chart.axis.CategoryLabelWidthTypeintVARIABLE_TYPE_MISMATCH
    org.jfree.chart.axis.CategoryLabelPositionorg.jfree.chart.axis.ColorBarVARIABLE_TYPE_MISMATCH
    widthTypecolorBarLengthVARIABLE_NAME_MISMATCH
    org.jfree.chart.axis.CategoryLabelWidthTypeintVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jfree.chart.axis.CategoryLabelWidthType of variable this.widthType does not match with type int of variable this.colorBarLength
    Type org.jfree.chart.axis.CategoryLabelWidthType of variable that.widthType does not match with type int of variable that.colorBarLength
    • Make classes org.jfree.chart.axis.CategoryLabelPosition and org.jfree.chart.axis.ColorBar extend a common superclass
    Expression that.widthType cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.colorBarLength 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 int of variable that.colorBarLength
    14
    if (this.colorBarLength != that.colorBarLength)
    15
    return false;
    15
    return false;
    16
    if (this.widthRatio != that.widthRatio)
    16
    if (this.widthRatio != that.widthRatio)
    8
    if (this.colorBarThickness != that.colorBarThickness)
    Differences
    Expression1Expression2Difference
    widthRatiocolorBarThicknessVARIABLE_NAME_MISMATCH
    floatintVARIABLE_TYPE_MISMATCH
    org.jfree.chart.axis.CategoryLabelPositionorg.jfree.chart.axis.ColorBarVARIABLE_TYPE_MISMATCH
    widthRatiocolorBarThicknessVARIABLE_NAME_MISMATCH
    floatintVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type float of variable this.widthRatio does not match with type int of variable this.colorBarThickness
    Type float of variable that.widthRatio does not match with type int of variable that.colorBarThickness
    • Make classes org.jfree.chart.axis.CategoryLabelPosition and org.jfree.chart.axis.ColorBar extend a common superclass
    Expression that.widthRatio cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.colorBarThickness 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.colorBarThickness
    8
    if (this.colorBarThickness != that.colorBarThickness)
    17
    return false;
    9
    return false;
    Precondition Violations (26)
    Row Violation
    1Type org.jfree.chart.axis.CategoryLabelPosition does not match with type org.jfree.chart.axis.ColorBar
    2Type org.jfree.ui.RectangleAnchor of variable that.categoryAnchor does not match with type org.jfree.chart.axis.ValueAxis of variable that.axis
    3Expression that.categoryAnchor cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression that.axis cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Type org.jfree.ui.RectangleAnchor of variable that.categoryAnchor does not match with type org.jfree.chart.axis.ValueAxis of variable that.axis
    6Type org.jfree.ui.RectangleAnchor of variable this.categoryAnchor does not match with type org.jfree.chart.axis.ValueAxis of variable this.axis
    7Type org.jfree.text.TextBlockAnchor of variable that.labelAnchor does not match with type org.jfree.chart.plot.ColorPalette of variable that.colorPalette
    8Expression that.labelAnchor cannot be parameterized, because it has dependencies to/from statements that will be extracted
    9Expression that.colorPalette cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10Type org.jfree.text.TextBlockAnchor of variable that.labelAnchor does not match with type org.jfree.chart.plot.ColorPalette of variable that.colorPalette
    11Type org.jfree.text.TextBlockAnchor of variable this.labelAnchor does not match with type org.jfree.chart.plot.ColorPalette of variable this.colorPalette
    12Unmatched return false;
    13Type double of variable that.angle does not match with type double of variable that.colorBarThicknessPercent
    14Expression that.angle cannot be parameterized, because it has dependencies to/from statements that will be extracted
    15Expression that.colorBarThicknessPercent cannot be parameterized, because it has dependencies to/from statements that will be extracted
    16Type org.jfree.chart.axis.CategoryLabelWidthType of variable this.widthType does not match with type int of variable this.colorBarLength
    17Type org.jfree.chart.axis.CategoryLabelWidthType of variable that.widthType does not match with type int of variable that.colorBarLength
    18Expression that.widthType cannot be parameterized, because it has dependencies to/from statements that will be extracted
    19Expression that.colorBarLength cannot be parameterized, because it has dependencies to/from statements that will be extracted
    20Type org.jfree.chart.axis.CategoryLabelWidthType of variable that.widthType does not match with type int of variable that.colorBarLength
    21Type float of variable this.widthRatio does not match with type int of variable this.colorBarThickness
    22Type float of variable that.widthRatio does not match with type int of variable that.colorBarThickness
    23Expression that.widthRatio cannot be parameterized, because it has dependencies to/from statements that will be extracted
    24Expression that.colorBarThickness cannot be parameterized, because it has dependencies to/from statements that will be extracted
    25Type float of variable that.widthRatio does not match with type int of variable that.colorBarThickness
    26Not all possible execution flows end in a return statement