if (this == obj) { return true; } if (!(obj instanceof CategoryLabelPositions)) { return false; } CategoryLabelPositions that = (CategoryLabelPositions) obj; if (!this.positionForAxisAtTop.equals(that.positionForAxisAtTop)) { return false; } if (!this.positionForAxisAtBottom.equals( that.positionForAxisAtBottom)) { return false; } if (!this.positionForAxisAtLeft.equals(that.positionForAxisAtLeft)) { return false; } if (!this.positionForAxisAtRight.equals(that.positionForAxisAtRight)) { return false; } return true;
if (obj == this) { return true; } if (!(obj instanceof ItemLabelPosition)) { return false; } ItemLabelPosition that = (ItemLabelPosition) obj; if (!this.itemLabelAnchor.equals(that.itemLabelAnchor)) { return false; } if (!this.textAnchor.equals(that.textAnchor)) { return false; } if (!this.rotationAnchor.equals(that.rotationAnchor)) { return false; } if (this.angle != that.angle) { return false; } return true;
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/axis/CategoryLabelPositions.java File path: /jfreechart-1.0.10/src/org/jfree/chart/labels/ItemLabelPosition.java
Method name: boolean equals(Object) Method name: boolean equals(Object)
Number of AST nodes: 14 Number of AST nodes: 14
1
if (this == obj) {
1
if (obj == this) {
2
            return true;
2
            return true;
3
        }
3
        }    
4
        if (!(obj instanceof CategoryLabelPositions)) {
4
        if (!(obj instanceof ItemLabelPosition)) {
5
            return false;
5
            return false;
6
        }
6
        }
7
        CategoryLabelPositions that = (CategoryLabelPositions) obj;
7
        ItemLabelPosition that = (ItemLabelPosition) obj;
8
        if (!this.positionForAxisAtTop.equals(that.positionForAxisAtTop)) {
8
        if (!this.itemLabelAnchor.equals(that.itemLabelAnchor)) {
9
            return false;
9
            return false;
10
        }
10
        }
11
        if (!this.positionForAxisAtBottom.equals(
11
        if (!this.
12
                that.positionForAxisAtBottom)) {
12
textAnchor.equals(that.textAnchor)) {
13
            return false;
13
            return false;
14
        }
14
        }
15
        if (!this.positionForAxisAtLeft.equals(that.positionForAxisAtLeft)) {
15
        if (!this.rotationAnchor.equals(that.rotationAnchor)) {
16
            return false;
16
            return false;
17
        }
17
        }
18
        if (!this.positionForAxisAtRight.equals(that.positionForAxisAtRight)) {
18
        if (this.angle != that.angle) {
19
            return false;
19
            return false;
20
        }
20
        }
21
  
21
     
22
        return true;
22
        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)2.8
Clones locationClones are in different classes
Number of node comparisons67
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements8
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)2.4
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    3
    if (!(obj instanceof CategoryLabelPositions))
    3
    if (!(obj instanceof CategoryLabelPositions))
    3
    if (!(obj instanceof ItemLabelPosition))
    Differences
    Expression1Expression2Difference
    org.jfree.chart.axis.CategoryLabelPositionsorg.jfree.chart.labels.ItemLabelPositionVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jfree.chart.axis.CategoryLabelPositions does not match with type org.jfree.chart.labels.ItemLabelPosition
    • Make classes org.jfree.chart.axis.CategoryLabelPositions and org.jfree.chart.labels.ItemLabelPosition extend a common superclass
    3
    if (!(obj instanceof ItemLabelPosition))
    4
    return false;
    4
    return false;
                                                                                                      
    5
    ItemLabelPosition that = (ItemLabelPosition)obj;
    5
    CategoryLabelPositions that = (CategoryLabelPositions)obj;
                                                                                                                          
    6
    if (!this.positionForAxisAtTop.equals(that.positionForAxisAtTop))
    6
    if (!this.positionForAxisAtTop.equals(that.positionForAxisAtTop))
    6
    if (!this.itemLabelAnchor.equals(that.itemLabelAnchor))
    Differences
    Expression1Expression2Difference
    org.jfree.chart.axis.CategoryLabelPositionsorg.jfree.chart.labels.ItemLabelPositionVARIABLE_TYPE_MISMATCH
    positionForAxisAtTopitemLabelAnchorVARIABLE_NAME_MISMATCH
    org.jfree.chart.axis.CategoryLabelPositionorg.jfree.chart.labels.ItemLabelAnchorVARIABLE_TYPE_MISMATCH
    positionForAxisAtTopitemLabelAnchorVARIABLE_NAME_MISMATCH
    org.jfree.chart.axis.CategoryLabelPositionorg.jfree.chart.labels.ItemLabelAnchorVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jfree.chart.axis.CategoryLabelPosition of variable that.positionForAxisAtTop does not match with type org.jfree.chart.labels.ItemLabelAnchor of variable that.itemLabelAnchor
    • Make classes org.jfree.chart.axis.CategoryLabelPositions and org.jfree.chart.labels.ItemLabelPosition extend a common superclass
    Expression that.positionForAxisAtTop cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.itemLabelAnchor cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type org.jfree.chart.axis.CategoryLabelPosition of variable that.positionForAxisAtTop does not match with type org.jfree.chart.labels.ItemLabelAnchor of variable that.itemLabelAnchor
    • Make classes org.jfree.chart.axis.CategoryLabelPosition and org.jfree.chart.labels.ItemLabelAnchor extend a common superclass
    Type org.jfree.chart.axis.CategoryLabelPosition of variable this.positionForAxisAtTop does not match with type org.jfree.chart.labels.ItemLabelAnchor of variable this.itemLabelAnchor
    • Make classes org.jfree.chart.axis.CategoryLabelPosition and org.jfree.chart.labels.ItemLabelAnchor extend a common superclass
    6
    if (!this.itemLabelAnchor.equals(that.itemLabelAnchor))
    7
    return false;
    7
    return false;
    8
    if (!this.positionForAxisAtBottom.equals(that.positionForAxisAtBottom))
    8
    if (!this.positionForAxisAtBottom.equals(that.positionForAxisAtBottom))
    8
    if (!this.textAnchor.equals(that.textAnchor))
    Differences
    Expression1Expression2Difference
    org.jfree.chart.axis.CategoryLabelPositionsorg.jfree.chart.labels.ItemLabelPositionVARIABLE_TYPE_MISMATCH
    positionForAxisAtBottomtextAnchorVARIABLE_NAME_MISMATCH
    org.jfree.chart.axis.CategoryLabelPositionorg.jfree.ui.TextAnchorVARIABLE_TYPE_MISMATCH
    positionForAxisAtBottomtextAnchorVARIABLE_NAME_MISMATCH
    org.jfree.chart.axis.CategoryLabelPositionorg.jfree.ui.TextAnchorVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jfree.chart.axis.CategoryLabelPosition of variable that.positionForAxisAtBottom does not match with type org.jfree.ui.TextAnchor of variable that.textAnchor
    • Make classes org.jfree.chart.axis.CategoryLabelPositions and org.jfree.chart.labels.ItemLabelPosition extend a common superclass
    Expression that.positionForAxisAtBottom cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.textAnchor cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type org.jfree.chart.axis.CategoryLabelPosition of variable that.positionForAxisAtBottom does not match with type org.jfree.ui.TextAnchor of variable that.textAnchor
    • Make classes org.jfree.chart.axis.CategoryLabelPosition and org.jfree.ui.TextAnchor extend a common superclass
    Type org.jfree.chart.axis.CategoryLabelPosition of variable this.positionForAxisAtBottom does not match with type org.jfree.ui.TextAnchor of variable this.textAnchor
    • Make classes org.jfree.chart.axis.CategoryLabelPosition and org.jfree.ui.TextAnchor extend a common superclass
    8
    if (!this.textAnchor.equals(that.textAnchor))
    9
    return false;
    9
    return false;
    10
    if (!this.positionForAxisAtLeft.equals(that.positionForAxisAtLeft))
    10
    if (!this.positionForAxisAtLeft.equals(that.positionForAxisAtLeft))
    10
    if (!this.rotationAnchor.equals(that.rotationAnchor))
    Differences
    Expression1Expression2Difference
    org.jfree.chart.axis.CategoryLabelPositionsorg.jfree.chart.labels.ItemLabelPositionVARIABLE_TYPE_MISMATCH
    positionForAxisAtLeftrotationAnchorVARIABLE_NAME_MISMATCH
    org.jfree.chart.axis.CategoryLabelPositionorg.jfree.ui.TextAnchorVARIABLE_TYPE_MISMATCH
    positionForAxisAtLeftrotationAnchorVARIABLE_NAME_MISMATCH
    org.jfree.chart.axis.CategoryLabelPositionorg.jfree.ui.TextAnchorVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jfree.chart.axis.CategoryLabelPosition of variable that.positionForAxisAtLeft does not match with type org.jfree.ui.TextAnchor of variable that.rotationAnchor
    • Make classes org.jfree.chart.axis.CategoryLabelPositions and org.jfree.chart.labels.ItemLabelPosition extend a common superclass
    Expression that.positionForAxisAtLeft cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.rotationAnchor cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type org.jfree.chart.axis.CategoryLabelPosition of variable that.positionForAxisAtLeft does not match with type org.jfree.ui.TextAnchor of variable that.rotationAnchor
    • Make classes org.jfree.chart.axis.CategoryLabelPosition and org.jfree.ui.TextAnchor extend a common superclass
    Type org.jfree.chart.axis.CategoryLabelPosition of variable this.positionForAxisAtLeft does not match with type org.jfree.ui.TextAnchor of variable this.rotationAnchor
    • Make classes org.jfree.chart.axis.CategoryLabelPosition and org.jfree.ui.TextAnchor extend a common superclass
    10
    if (!this.rotationAnchor.equals(that.rotationAnchor))
    11
    return false;
    11
    return false;
    Precondition Violations (17)
    Row Violation
    1Type org.jfree.chart.axis.CategoryLabelPositions does not match with type org.jfree.chart.labels.ItemLabelPosition
    2Type org.jfree.chart.axis.CategoryLabelPosition of variable that.positionForAxisAtTop does not match with type org.jfree.chart.labels.ItemLabelAnchor of variable that.itemLabelAnchor
    3Expression that.positionForAxisAtTop cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression that.itemLabelAnchor cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Type org.jfree.chart.axis.CategoryLabelPosition of variable that.positionForAxisAtTop does not match with type org.jfree.chart.labels.ItemLabelAnchor of variable that.itemLabelAnchor
    6Type org.jfree.chart.axis.CategoryLabelPosition of variable this.positionForAxisAtTop does not match with type org.jfree.chart.labels.ItemLabelAnchor of variable this.itemLabelAnchor
    7Type org.jfree.chart.axis.CategoryLabelPosition of variable that.positionForAxisAtBottom does not match with type org.jfree.ui.TextAnchor of variable that.textAnchor
    8Expression that.positionForAxisAtBottom cannot be parameterized, because it has dependencies to/from statements that will be extracted
    9Expression that.textAnchor cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10Type org.jfree.chart.axis.CategoryLabelPosition of variable that.positionForAxisAtBottom does not match with type org.jfree.ui.TextAnchor of variable that.textAnchor
    11Type org.jfree.chart.axis.CategoryLabelPosition of variable this.positionForAxisAtBottom does not match with type org.jfree.ui.TextAnchor of variable this.textAnchor
    12Type org.jfree.chart.axis.CategoryLabelPosition of variable that.positionForAxisAtLeft does not match with type org.jfree.ui.TextAnchor of variable that.rotationAnchor
    13Expression that.positionForAxisAtLeft cannot be parameterized, because it has dependencies to/from statements that will be extracted
    14Expression that.rotationAnchor cannot be parameterized, because it has dependencies to/from statements that will be extracted
    15Type org.jfree.chart.axis.CategoryLabelPosition of variable that.positionForAxisAtLeft does not match with type org.jfree.ui.TextAnchor of variable that.rotationAnchor
    16Type org.jfree.chart.axis.CategoryLabelPosition of variable this.positionForAxisAtLeft does not match with type org.jfree.ui.TextAnchor of variable this.rotationAnchor
    17Not all possible execution flows end in a return statement