if (obj == this) { return true; } if (!(obj instanceof CategoryLabelEntity)) { return false; } CategoryLabelEntity that = (CategoryLabelEntity) obj; if (!ObjectUtilities.equal(this.key, that.key)) { return false; } return super.equals(obj);
if (obj == this) { return true; } if (!(obj instanceof StatisticalLineAndShapeRenderer)) { return false; } StatisticalLineAndShapeRenderer that = (StatisticalLineAndShapeRenderer) obj; if (!PaintUtilities.equal(this.errorIndicatorPaint, that.errorIndicatorPaint)) { return false; } return super.equals(obj);
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/entity/CategoryLabelEntity.java File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/category/StatisticalLineAndShapeRenderer.java
Method name: boolean equals(Object) Method name: boolean equals(Object)
Number of AST nodes: 8 Number of AST nodes: 8
1
if (obj == this) {
1
if (obj == this) {
2
            return true;
2
            return true;
3
        }
3
        }
4
        if (!(obj instanceof CategoryLabelEntity)) {
4
        if (!(obj instanceof StatisticalLineAndShapeRenderer)) {
5
            return false;
5
            return false;
6
        }
6
        }
7
        CategoryLabelEntity that = (CategoryLabelEntity
7
        StatisticalLineAndShapeRenderer that
8
) obj;
8
                = (StatisticalLineAndShapeRenderer) obj;
9
        if (!ObjectUtilities.equal(this.key, that.key
9
        if (!PaintUtilities.equal(this.errorIndicatorPaint,
10
)) {
10
                that.errorIndicatorPaint)) {
11
            return false;
11
            return false;
12
        }
12
        }
13
        return super.equals(obj);
13
        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)0.9
Clones locationClones are in different classes
Number of node comparisons25
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements8
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)2.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 CategoryLabelEntity))
    3
    if (!(obj instanceof CategoryLabelEntity))
    3
    if (!(obj instanceof StatisticalLineAndShapeRenderer))
    Differences
    Expression1Expression2Difference
    org.jfree.chart.entity.CategoryLabelEntityorg.jfree.chart.renderer.category.StatisticalLineAndShapeRendererSUBCLASS_TYPE_MISMATCH
    3
    if (!(obj instanceof StatisticalLineAndShapeRenderer))
    4
    return false;
    4
    return false;
    5
    CategoryLabelEntity that = (CategoryLabelEntity)obj;
    5
    CategoryLabelEntity that = (CategoryLabelEntity)obj;
    5
    StatisticalLineAndShapeRenderer that = (StatisticalLineAndShapeRenderer)obj;
    Differences
    Expression1Expression2Difference
    org.jfree.chart.entity.CategoryLabelEntityorg.jfree.chart.renderer.category.StatisticalLineAndShapeRendererSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.entity.CategoryLabelEntityorg.jfree.chart.renderer.category.StatisticalLineAndShapeRendererSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.entity.CategoryLabelEntityorg.jfree.chart.renderer.category.StatisticalLineAndShapeRendererSUBCLASS_TYPE_MISMATCH
    5
    StatisticalLineAndShapeRenderer that = (StatisticalLineAndShapeRenderer)obj;
    6
    if (!ObjectUtilities.equal(this.key, that.key))
    6
    if (!ObjectUtilities.equal(this.key, that.key))
    6
    if (!PaintUtilities.equal(this.errorIndicatorPaint, that.errorIndicatorPaint))
    Differences
    Expression1Expression2Difference
    keyerrorIndicatorPaintVARIABLE_NAME_MISMATCH
    java.lang.Comparablejava.awt.PaintVARIABLE_TYPE_MISMATCH
    org.jfree.chart.entity.CategoryLabelEntityorg.jfree.chart.renderer.category.StatisticalLineAndShapeRendererSUBCLASS_TYPE_MISMATCH
    keyerrorIndicatorPaintVARIABLE_NAME_MISMATCH
    java.lang.Comparablejava.awt.PaintVARIABLE_TYPE_MISMATCH
    org.jfree.util.ObjectUtilitiesorg.jfree.util.PaintUtilitiesVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.lang.Comparable of variable this.key does not match with type java.awt.Paint of variable this.errorIndicatorPaint
    • Make classes java.lang.Comparable and java.awt.Paint extend a common superclass
    Expression that.key cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.errorIndicatorPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type java.lang.Comparable of variable that.key does not match with type java.awt.Paint of variable that.errorIndicatorPaint
    • Make classes java.lang.Comparable and java.awt.Paint extend a common superclass
    Type org.jfree.util.ObjectUtilities does not match with type org.jfree.util.PaintUtilities
    • Make classes org.jfree.util.ObjectUtilities and org.jfree.util.PaintUtilities extend a common superclass
    6
    if (!PaintUtilities.equal(this.errorIndicatorPaint, that.errorIndicatorPaint))
    7
    return false;
    7
    return false;
    8
    return super.equals(obj);
    8
    return super.equals(obj);
    8
    return super.equals(obj);
    Preondition Violations
    Super method call return super.equals(obj); cannot be extracted from method
    Super method call return super.equals(obj); cannot be extracted from method
    8
    return super.equals(obj);
    Precondition Violations (8)
    Row Violation
    1Type java.lang.Comparable of variable this.key does not match with type java.awt.Paint of variable this.errorIndicatorPaint
    2Expression that.key cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression that.errorIndicatorPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Type java.lang.Comparable of variable that.key does not match with type java.awt.Paint of variable that.errorIndicatorPaint
    5Type org.jfree.util.ObjectUtilities does not match with type org.jfree.util.PaintUtilities
    6Super method call return super.equals(obj); cannot be extracted from method
    7Super method call return super.equals(obj); cannot be extracted from method
    8The refactoring of the clones is infeasible, because classes org.jfree.chart.entity.CategoryLabelEntity and org.jfree.chart.renderer.category.StatisticalLineAndShapeRenderer do not have a common superclass