if (obj == this) { return true; } if (!(obj instanceof AbstractCategoryItemLabelGenerator)) { return false; } AbstractCategoryItemLabelGenerator that = (AbstractCategoryItemLabelGenerator) obj; if (!this.labelFormat.equals(that.labelFormat)) { return false; } if (!ObjectUtilities.equal(this.dateFormat, that.dateFormat)) { return false; } if (!ObjectUtilities.equal(this.numberFormat, that.numberFormat)) { return false; } return true;
if (obj == this) { return true; } if (!(obj instanceof BarRenderer3D)) { return false; } BarRenderer3D that = (BarRenderer3D) obj; if (this.xOffset != that.xOffset) { return false; } if (this.yOffset != that.yOffset) { return false; } if (!PaintUtilities.equal(this.wallPaint, that.wallPaint)) { return false; } return super.equals(obj);
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/labels/AbstractCategoryItemLabelGenerator.java File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/category/BarRenderer3D.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 AbstractCategoryItemLabelGenerator)) {
4
        if (!(obj instanceof BarRenderer3D)) {
5
            return false;
5
            return false;
6
        }
6
        }
7
        
7
        
8
        AbstractCategoryItemLabelGenerator that 
8
BarRenderer3D that 
9
            = (AbstractCategoryItemLabelGenerator) obj;
9
= (BarRenderer3D) obj;
10
        if (!this.labelFormat.equals(that.labelFormat)) {
10
        if (this.xOffset != that.xOffset) {
11
            return false;
11
            return false;
12
        }
12
        }
13
        if (!ObjectUtilities.equal(this.dateFormat, that.dateFormat)) {
13
        if (this.yOffset != that.yOffset) {
14
            return false;
14
            return false;
15
        }
15
        }
16
        if (!ObjectUtilities.equal(this.numberFormat, that.numberFormat)) {
16
        if (!PaintUtilities.equal(this.wallPaint, that.wallPaint)) {
17
            return false;
17
            return false;
18
        }
18
        }
19
        return true;
19
        return super.equals(obj);
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)1.8
Clones locationClones are in different classes
Number of node comparisons38
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements7
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment4
    Time elapsed for statement mapping (ms)2.8
    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 AbstractCategoryItemLabelGenerator))
    3
    if (!(obj instanceof AbstractCategoryItemLabelGenerator))
    3
    if (!(obj instanceof BarRenderer3D))
    Differences
    Expression1Expression2Difference
    org.jfree.chart.labels.AbstractCategoryItemLabelGeneratororg.jfree.chart.renderer.category.BarRenderer3DSUBCLASS_TYPE_MISMATCH
    3
    if (!(obj instanceof BarRenderer3D))
    4
    return false;
    4
    return false;
    5
    AbstractCategoryItemLabelGenerator that = (AbstractCategoryItemLabelGenerator)obj;
    5
    AbstractCategoryItemLabelGenerator that = (AbstractCategoryItemLabelGenerator)obj;
    5
    BarRenderer3D that = (BarRenderer3D)obj;
    Differences
    Expression1Expression2Difference
    org.jfree.chart.labels.AbstractCategoryItemLabelGeneratororg.jfree.chart.renderer.category.BarRenderer3DSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.labels.AbstractCategoryItemLabelGeneratororg.jfree.chart.renderer.category.BarRenderer3DSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.labels.AbstractCategoryItemLabelGeneratororg.jfree.chart.renderer.category.BarRenderer3DSUBCLASS_TYPE_MISMATCH
    5
    BarRenderer3D that = (BarRenderer3D)obj;
                                                                          
    6
    if (this.xOffset != that.xOffset)
    Preondition Violations
    Unmatched statement if(this.xOffset != that.xOffset) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    6
    if (this.xOffset != that.xOffset)
                                    
    7
    return false;
    Preondition Violations
    Unmatched return false;
    7
    return false;
                                                                          
    8
    if (this.yOffset != that.yOffset)
    Preondition Violations
    Unmatched statement if(this.yOffset != that.yOffset) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    8
    if (this.yOffset != that.yOffset)
                                    
    9
    return false;
    Preondition Violations
    Unmatched return false;
    9
    return false;
    6
    if (!this.labelFormat.equals(that.labelFormat))
    6
    if (!this.labelFormat.equals(that.labelFormat))
    10
    if (!PaintUtilities.equal(this.wallPaint, that.wallPaint))
    Differences
    Expression1Expression2Difference
    this.labelFormat.equals(that.labelFormat)PaintUtilities.equal(this.wallPaint,that.wallPaint)TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression this.labelFormat.equals(that.labelFormat) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression PaintUtilities.equal(this.wallPaint,that.wallPaint) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10
    if (!PaintUtilities.equal(this.wallPaint, that.wallPaint))
    7
    return false;
    11
    return false;
    Precondition Violations (9)
    Row Violation
    1Unmatched statement if(this.xOffset != that.xOffset) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Unmatched return false;
    3Unmatched statement if(this.yOffset != that.yOffset) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    4Unmatched return false;
    5Expression this.labelFormat.equals(that.labelFormat) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression PaintUtilities.equal(this.wallPaint,that.wallPaint) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Clone fragment #1 returns variable that with type org.jfree.chart.labels.AbstractCategoryItemLabelGenerator , while Clone fragment #2 returns variable that with type org.jfree.chart.renderer.category.BarRenderer3D
    8Not all possible execution flows end in a return statement
    9The refactoring of the clones is infeasible, because classes org.jfree.chart.labels.AbstractCategoryItemLabelGenerator and org.jfree.chart.renderer.category.BarRenderer3D do not have a common superclass