if (obj == this) { return true; } if (!(obj instanceof ExtendedCategoryAxis)) { return false; } ExtendedCategoryAxis that = (ExtendedCategoryAxis) obj; if (!this.sublabelFont.equals(that.sublabelFont)) { return false; } if (!PaintUtilities.equal(this.sublabelPaint, that.sublabelPaint)) { return false; } if (!this.sublabels.equals(that.sublabels)) { return false; } return super.equals(obj);
if (obj == this) { return true; } if (obj instanceof SubCategoryAxis && super.equals(obj)) { SubCategoryAxis axis = (SubCategoryAxis) obj; if (!this.subCategories.equals(axis.subCategories)) { return false; } if (!this.subLabelFont.equals(axis.subLabelFont)) { return false; } if (!this.subLabelPaint.equals(axis.subLabelPaint)) { return false; } return true; } return false;
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/axis/ExtendedCategoryAxis.java File path: /jfreechart-1.0.10/src/org/jfree/chart/axis/SubCategoryAxis.java
Method name: boolean equals(Object) Method name: boolean equals(Object)
Number of AST nodes: 12 Number of AST nodes: 12
1
if (obj == this) {
1
if (obj == this) {
2
            return true;
2
            return true;
3
        }
3
        }
4
        if (!(obj instanceof ExtendedCategoryAxis)) {
4
        if (obj instanceof SubCategoryAxis
5
            return false;
5
 && super.equals(obj)) {
6
        }
6
        
7
        ExtendedCategoryAxis that = (ExtendedCategoryAxis) obj;
7
    SubCategoryAxis axis = (SubCategoryAxis) obj;
8
        if (!this.sublabelFont.equals(that.sublabelFont)) {
8
            if (!this.subCategories.equals(axis.subCategories)) {
9
            return false;
9
                return false;
10
        }
10
        
11
    }
11
        if (!PaintUtilities.equal(this.sublabelPaint, that.sublabelPaint)) {
12
            if (!this.subLabelFont.equals(axis.subLabelFont)) {
12
            return false;
13
                return false;
14
   
13
        }
15
            }
14
        if (!this.sublabels.equals(that.sublabels)) {
16
            if (!this.subLabelPaint.equals(axis.subLabelPaint)) {
15
            return false;
17
                return false;   
16
        }
18
            }
17
        return super.equals(obj)
19
            return true;
20
        }
18
;
21
        return false;
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.3
Clones locationClones are in different classes having the same super class
Number of node comparisons34
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements6
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)29.1
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
                                                                                              
    4
    SubCategoryAxis axis = (SubCategoryAxis)obj;
    3
    if (!(obj instanceof ExtendedCategoryAxis))
    3
    if (!(obj instanceof ExtendedCategoryAxis))
    5
    if (!this.subCategories.equals(axis.subCategories))
    Differences
    Expression1Expression2Difference
    (obj instanceof ExtendedCategoryAxis)this.subCategories.equals(axis.subCategories)TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression this.subCategories.equals(axis.subCategories) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5
    if (!this.subCategories.equals(axis.subCategories))
    4
    return false;
    6
    return false;
    5
    ExtendedCategoryAxis that = (ExtendedCategoryAxis)obj;
                                                                                                                  
    6
    if (!this.sublabelFont.equals(that.sublabelFont))
    6
    if (!this.sublabelFont.equals(that.sublabelFont))
    7
    if (!this.subLabelFont.equals(axis.subLabelFont))
    Differences
    Expression1Expression2Difference
    thataxisVARIABLE_NAME_MISMATCH
    org.jfree.chart.axis.ExtendedCategoryAxisorg.jfree.chart.axis.SubCategoryAxisSUBCLASS_TYPE_MISMATCH
    sublabelFontsubLabelFontVARIABLE_NAME_MISMATCH
    sublabelFontsubLabelFontVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression that.sublabelFont cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression axis.subLabelFont cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.sublabelFont cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression axis.subLabelFont cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7
    if (!this.subLabelFont.equals(axis.subLabelFont))
    7
    return false;
    8
    return false;
    8
    if (!PaintUtilities.equal(this.sublabelPaint, that.sublabelPaint))
    8
    if (!PaintUtilities.equal(this.sublabelPaint, that.sublabelPaint))
    9
    if (!this.subLabelPaint.equals(axis.subLabelPaint))
    Differences
    Expression1Expression2Difference
    PaintUtilities.equal(this.sublabelPaint,that.sublabelPaint)this.subLabelPaint.equals(axis.subLabelPaint)TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression PaintUtilities.equal(this.sublabelPaint,that.sublabelPaint) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression this.subLabelPaint.equals(axis.subLabelPaint) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    9
    if (!this.subLabelPaint.equals(axis.subLabelPaint))
    9
    return false;
    10
    return false;
    Precondition Violations (8)
    Row Violation
    1Expression this.subCategories.equals(axis.subCategories) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression that.sublabelFont cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression axis.subLabelFont cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression that.sublabelFont cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression axis.subLabelFont cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression PaintUtilities.equal(this.sublabelPaint,that.sublabelPaint) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression this.subLabelPaint.equals(axis.subLabelPaint) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Not all possible execution flows end in a return statement