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 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/CategoryLabelPosition.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 CategoryLabelPosition)) {
4
        if (!(obj instanceof MarkerAxisBand)) {
5
            return false;
5
            return false;
6
        }
6
        }
7
        CategoryLabelPosition that = (CategoryLabelPosition) obj;
7
        MarkerAxisBand that = (MarkerAxisBand) obj;
8
        if (!this.categoryAnchor.equals(that.categoryAnchor)) {
8
        if (this.topOuterGap != that.topOuterGap) {
9
            return false;
9
            return false;
10
        }
10
        }
11
        if (!this.labelAnchor.equals(that.labelAnchor)) {
11
        if (this.topInnerGap != that.topInnerGap) {
12
            return false;
12
            return false;
13
        }
13
        }
14
        if (!this.rotationAnchor.equals(that.rotationAnchor)) {
14
        if (this.bottomInnerGap != that.bottomInnerGap) {
15
            return false;
15
            return false;
16
        }
16
        }
17
        if (this.angle != that.angle) {
17
        if (this.bottomOuterGap != that.bottomOuterGap) {
18
            return false;
18
            return false;
19
        }
19
        }
20
        if (this.widthType != that.widthType) {
20
        if (!ObjectUtilities.equal(this.font, that.font)) {
21
            return false;
21
            return false;
22
        }
22
        }
23
        if (this.widthRatio != that.widthRatio) {
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.2
Clones locationClones are in different classes
Number of node comparisons113
  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 fragment3
    Time elapsed for statement mapping (ms)4.1
    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 MarkerAxisBand))
    Differences
    Expression1Expression2Difference
    org.jfree.chart.axis.CategoryLabelPositionorg.jfree.chart.axis.MarkerAxisBandVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jfree.chart.axis.CategoryLabelPosition does not match with type org.jfree.chart.axis.MarkerAxisBand
    • Make classes org.jfree.chart.axis.CategoryLabelPosition 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
    CategoryLabelPosition that = (CategoryLabelPosition)obj;
                                                                                                                      
                                                                                          
    6
    if (this.topOuterGap != that.topOuterGap)
                                    
    7
    return false;
    Preondition Violations
    Unmatched return false;
    7
    return false;
    6
    if (!this.categoryAnchor.equals(that.categoryAnchor))
    6
    if (!this.categoryAnchor.equals(that.categoryAnchor))
    14
    if (!ObjectUtilities.equal(this.font, that.font))
    Differences
    Expression1Expression2Difference
    this.categoryAnchor.equals(that.categoryAnchor)ObjectUtilities.equal(this.font,that.font)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 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.labelAnchor.equals(that.labelAnchor))
    8
    if (!this.labelAnchor.equals(that.labelAnchor))
    16
    if (!ObjectUtilities.equal(this.markers, that.markers))
    Differences
    Expression1Expression2Difference
    this.labelAnchor.equals(that.labelAnchor)ObjectUtilities.equal(this.markers,that.markers)TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression this.labelAnchor.equals(that.labelAnchor) 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))
    9
    return false;
    17
    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)
    12
    if (this.bottomOuterGap != that.bottomOuterGap)
    Differences
    Expression1Expression2Difference
    anglebottomOuterGapVARIABLE_NAME_MISMATCH
    org.jfree.chart.axis.CategoryLabelPositionorg.jfree.chart.axis.MarkerAxisBandVARIABLE_TYPE_MISMATCH
    anglebottomOuterGapVARIABLE_NAME_MISMATCH
    Preondition Violations
    Type double of variable that.angle does not match with type double of variable that.bottomOuterGap
    • Make classes org.jfree.chart.axis.CategoryLabelPosition and org.jfree.chart.axis.MarkerAxisBand extend a common superclass
    Expression that.angle 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
    12
    if (this.bottomOuterGap != that.bottomOuterGap)
    13
    return false;
    13
    return false;
    14
    if (this.widthType != that.widthType)
    14
    if (this.widthType != that.widthType)
    10
    if (this.bottomInnerGap != that.bottomInnerGap)
    Differences
    Expression1Expression2Difference
    widthTypebottomInnerGapVARIABLE_NAME_MISMATCH
    org.jfree.chart.axis.CategoryLabelWidthTypedoubleVARIABLE_TYPE_MISMATCH
    org.jfree.chart.axis.CategoryLabelPositionorg.jfree.chart.axis.MarkerAxisBandVARIABLE_TYPE_MISMATCH
    widthTypebottomInnerGapVARIABLE_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.bottomInnerGap
    Type org.jfree.chart.axis.CategoryLabelWidthType of variable that.widthType does not match with type double of variable that.bottomInnerGap
    • Make classes org.jfree.chart.axis.CategoryLabelPosition and org.jfree.chart.axis.MarkerAxisBand extend a common superclass
    Expression that.widthType 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
    Type org.jfree.chart.axis.CategoryLabelWidthType of variable that.widthType does not match with type double of variable that.bottomInnerGap
    10
    if (this.bottomInnerGap != that.bottomInnerGap)
    15
    return false;
    11
    return false;
    16
    if (this.widthRatio != that.widthRatio)
    16
    if (this.widthRatio != that.widthRatio)
    8
    if (this.topInnerGap != that.topInnerGap)
    Differences
    Expression1Expression2Difference
    widthRatiotopInnerGapVARIABLE_NAME_MISMATCH
    floatdoubleVARIABLE_TYPE_MISMATCH
    org.jfree.chart.axis.CategoryLabelPositionorg.jfree.chart.axis.MarkerAxisBandVARIABLE_TYPE_MISMATCH
    widthRatiotopInnerGapVARIABLE_NAME_MISMATCH
    floatdoubleVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type float of variable this.widthRatio does not match with type double of variable this.topInnerGap
    Type float of variable that.widthRatio does not match with type double of variable that.topInnerGap
    • Make classes org.jfree.chart.axis.CategoryLabelPosition and org.jfree.chart.axis.MarkerAxisBand extend a common superclass
    Expression that.widthRatio 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 float of variable that.widthRatio does not match with type double of variable that.topInnerGap
    8
    if (this.topInnerGap != that.topInnerGap)
    17
    return false;
    9
    return false;
    Precondition Violations (21)
    Row Violation
    1Type org.jfree.chart.axis.CategoryLabelPosition does not match with type org.jfree.chart.axis.MarkerAxisBand
    2Unmatched return false;
    3Expression this.categoryAnchor.equals(that.categoryAnchor) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression ObjectUtilities.equal(this.font,that.font) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression this.labelAnchor.equals(that.labelAnchor) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression ObjectUtilities.equal(this.markers,that.markers) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Unmatched return false;
    8Type double of variable that.angle does not match with type double of variable that.bottomOuterGap
    9Expression that.angle cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10Expression that.bottomOuterGap cannot be parameterized, because it has dependencies to/from statements that will be extracted
    11Type org.jfree.chart.axis.CategoryLabelWidthType of variable this.widthType does not match with type double of variable this.bottomInnerGap
    12Type org.jfree.chart.axis.CategoryLabelWidthType of variable that.widthType does not match with type double of variable that.bottomInnerGap
    13Expression that.widthType cannot be parameterized, because it has dependencies to/from statements that will be extracted
    14Expression that.bottomInnerGap cannot be parameterized, because it has dependencies to/from statements that will be extracted
    15Type org.jfree.chart.axis.CategoryLabelWidthType of variable that.widthType does not match with type double of variable that.bottomInnerGap
    16Type float of variable this.widthRatio does not match with type double of variable this.topInnerGap
    17Type float of variable that.widthRatio does not match with type double of variable that.topInnerGap
    18Expression that.widthRatio cannot be parameterized, because it has dependencies to/from statements that will be extracted
    19Expression that.topInnerGap cannot be parameterized, because it has dependencies to/from statements that will be extracted
    20Type float of variable that.widthRatio does not match with type double of variable that.topInnerGap
    21Not all possible execution flows end in a return statement