if (obj == this) { return true; } if (!(obj instanceof SymbolAxis)) { return false; } SymbolAxis that = (SymbolAxis) obj; if (!this.symbols.equals(that.symbols)) { return false; } if (this.gridBandsVisible != that.gridBandsVisible) { return false; } if (!PaintUtilities.equal(this.gridBandPaint, that.gridBandPaint)) { return false; } if (!PaintUtilities.equal(this.gridBandAlternatePaint, that.gridBandAlternatePaint)) { return false; } return super.equals(obj);
if (obj == this) { return true; } if (!(obj instanceof DefaultIntervalCategoryDataset)) { return false; } DefaultIntervalCategoryDataset that = (DefaultIntervalCategoryDataset) obj; if (!Arrays.equals(this.seriesKeys, that.seriesKeys)) { return false; } if (!Arrays.equals(this.categoryKeys, that.categoryKeys)) { return false; } if (!equal(this.startData, that.startData)) { return false; } if (!equal(this.endData, that.endData)) { return false; } // seem to be the same... return true;
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/axis/SymbolAxis.java File path: /jfreechart-1.0.10/src/org/jfree/data/category/DefaultIntervalCategoryDataset.java
Method name: boolean equals(Object) Method name: boolean equals(Object)
Number of AST nodes: 14 Number of AST nodes: 14
1
if (obj == this) {
1
if (obj == this) {
2
            return true;
2
            return true;
3
        }
3
        }
4
        if (!(obj instanceof SymbolAxis)) {
4
        if (!(obj instanceof DefaultIntervalCategoryDataset)) {
5
            return false;
5
            return false;
6
        }
6
        }
7
        SymbolAxis that = (SymbolAxis) obj;
7
        
8
        if (!this.symbols.equals(that.symbol
8
DefaultIntervalCategoryDataset that 
9
                = (DefaultIntervalCategoryDataset) obj;
9
s)) {
10
        if (!Arrays.equals(this.seriesKeys, that.seriesKeys)) {
10
            return false;
11
            return false;
11
        }
12
        }
12
        if (this.gridBandsVisible != that.gridBandsVisible) {
13
        if (!Arrays.equals(this.categoryKeys, that.categoryKeys)) {
13
            return false;
14
            return false;
14
        }
15
        }
15
        if (!PaintUtilities.equal(this.gridBandPaint, that.gridBandPaint)) {
16
        if (!equal(this.startData, that.startData)) {
16
            return false;
17
            return false;
17
        }
18
        }
18
        if (!PaintUtilities.equal(this.gridBandAlternatePaint, 
19
        if (!
19
                that.gridBandAlternatePaint)) {
20
equal(this.endData, that.endData)) {
20
            return false;
21
            return false;
21
        }
22
        }
22
        return super.equals(obj)
23
        // seem to be the same...
23
;
24
        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)5.0
Clones locationClones are in different classes
Number of node comparisons49
  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)3.5
    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 SymbolAxis))
    3
    if (!(obj instanceof SymbolAxis))
    3
    if (!(obj instanceof DefaultIntervalCategoryDataset))
    Differences
    Expression1Expression2Difference
    org.jfree.chart.axis.SymbolAxisorg.jfree.data.category.DefaultIntervalCategoryDatasetVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jfree.chart.axis.SymbolAxis does not match with type org.jfree.data.category.DefaultIntervalCategoryDataset
    • Make classes org.jfree.chart.axis.SymbolAxis and org.jfree.data.category.DefaultIntervalCategoryDataset extend a common superclass
    3
    if (!(obj instanceof DefaultIntervalCategoryDataset))
    4
    return false;
    4
    return false;
                                                                                                                                                          
    5
    DefaultIntervalCategoryDataset that = (DefaultIntervalCategoryDataset)obj;
    5
    SymbolAxis that = (SymbolAxis)obj;
                                                                          
    6
    if (!this.symbols.equals(that.symbols))
    6
    if (!this.symbols.equals(that.symbols))
    6
    if (!Arrays.equals(this.seriesKeys, that.seriesKeys))
    Differences
    Expression1Expression2Difference
    this.symbols.equals(that.symbols)Arrays.equals(this.seriesKeys,that.seriesKeys)TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression this.symbols.equals(that.symbols) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression Arrays.equals(this.seriesKeys,that.seriesKeys) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6
    if (!Arrays.equals(this.seriesKeys, that.seriesKeys))
    7
    return false;
    7
    return false;
    Precondition Violations (5)
    Row Violation
    1Type org.jfree.chart.axis.SymbolAxis does not match with type org.jfree.data.category.DefaultIntervalCategoryDataset
    2Expression this.symbols.equals(that.symbols) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression Arrays.equals(this.seriesKeys,that.seriesKeys) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Not all possible execution flows end in a return statement
    5The refactoring of the clones is infeasible, because classes org.jfree.chart.axis.SymbolAxis and org.jfree.data.category.DefaultIntervalCategoryDataset do not have a common superclass