if (obj == this) { return true; } if (!(obj instanceof ChartRenderingInfo)) { return false; } ChartRenderingInfo that = (ChartRenderingInfo) obj; if (!ObjectUtilities.equal(this.chartArea, that.chartArea)) { return false; } if (!ObjectUtilities.equal(this.plotInfo, that.plotInfo)) { return false; } if (!ObjectUtilities.equal(this.entities, that.entities)) { return false; } return true;
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);
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/ChartRenderingInfo.java File path: /jfreechart-1.0.10/src/org/jfree/chart/axis/ExtendedCategoryAxis.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 ChartRenderingInfo)) {
4
        if (!(obj instanceof ExtendedCategoryAxis)) {
5
            return false;
5
            return false;
6
        }
6
        }
7
        ChartRenderingInfo that = (ChartRenderingInfo) obj;
7
        ExtendedCategoryAxis that = (ExtendedCategoryAxis) obj;
8
        if (!ObjectUtilities.equal(this.chartArea, that.chartArea)) {
8
        if (!this.sublabelFont.equals(that.sublabelFont)) {
9
            return false;   
9
            return false;
10
        }
10
        }
11
        if (!ObjectUtilities.equal(this.plotInfo, that.plotInfo)) {
11
        if (!PaintUtilities.equal(this.sublabelPaint, that.sublabelPaint)) {
12
            return false;
12
            return false;
13
        }
13
        }
14
        if (!ObjectUtilities.equal(this.entities, that.entities)) {
14
        if (!this.sublabels.equals(that.sublabels)) {
15
            return false;
15
            return false;
16
        }
16
        }
17
        return true;
17
        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.9
Clones locationClones are in different classes
Number of node comparisons62
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements11
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)5.7
    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 ChartRenderingInfo))
    3
    if (!(obj instanceof ChartRenderingInfo))
    3
    if (!(obj instanceof ExtendedCategoryAxis))
    Differences
    Expression1Expression2Difference
    org.jfree.chart.ChartRenderingInfoorg.jfree.chart.axis.ExtendedCategoryAxisVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jfree.chart.ChartRenderingInfo does not match with type org.jfree.chart.axis.ExtendedCategoryAxis
    • Make classes org.jfree.chart.ChartRenderingInfo and org.jfree.chart.axis.ExtendedCategoryAxis extend a common superclass
    3
    if (!(obj instanceof ExtendedCategoryAxis))
    4
    return false;
    4
    return false;
                                                                                                                  
    5
    ExtendedCategoryAxis that = (ExtendedCategoryAxis)obj;
    5
    ChartRenderingInfo that = (ChartRenderingInfo)obj;
                                                                                                          
    6
    if (!ObjectUtilities.equal(this.chartArea, that.chartArea))
    6
    if (!ObjectUtilities.equal(this.chartArea, that.chartArea))
    8
    if (!PaintUtilities.equal(this.sublabelPaint, that.sublabelPaint))
    Differences
    Expression1Expression2Difference
    chartAreasublabelPaintVARIABLE_NAME_MISMATCH
    java.awt.geom.Rectangle2Djava.awt.PaintVARIABLE_TYPE_MISMATCH
    org.jfree.chart.ChartRenderingInfoorg.jfree.chart.axis.ExtendedCategoryAxisVARIABLE_TYPE_MISMATCH
    chartAreasublabelPaintVARIABLE_NAME_MISMATCH
    java.awt.geom.Rectangle2Djava.awt.PaintVARIABLE_TYPE_MISMATCH
    org.jfree.util.ObjectUtilitiesorg.jfree.util.PaintUtilitiesVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.awt.geom.Rectangle2D of variable this.chartArea does not match with type java.awt.Paint of variable this.sublabelPaint
    • Make classes java.awt.geom.Rectangle2D and java.awt.Paint extend a common superclass
    Type java.awt.geom.Rectangle2D of variable that.chartArea does not match with type java.awt.Paint of variable that.sublabelPaint
    • Make classes org.jfree.chart.ChartRenderingInfo and org.jfree.chart.axis.ExtendedCategoryAxis extend a common superclass
    Expression that.chartArea cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.sublabelPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type java.awt.geom.Rectangle2D of variable that.chartArea does not match with type java.awt.Paint of variable that.sublabelPaint
    • Make classes java.awt.geom.Rectangle2D 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
    8
    if (!PaintUtilities.equal(this.sublabelPaint, that.sublabelPaint))
    7
    return false;
    9
    return false;
    8
    if (!ObjectUtilities.equal(this.plotInfo, that.plotInfo))
    8
    if (!ObjectUtilities.equal(this.plotInfo, that.plotInfo))
    6
    if (!this.sublabelFont.equals(that.sublabelFont))
    Differences
    Expression1Expression2Difference
    ObjectUtilities.equal(this.plotInfo,that.plotInfo)this.sublabelFont.equals(that.sublabelFont)TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression ObjectUtilities.equal(this.plotInfo,that.plotInfo) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression this.sublabelFont.equals(that.sublabelFont) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6
    if (!this.sublabelFont.equals(that.sublabelFont))
    9
    return false;
    7
    return false;
    10
    if (!ObjectUtilities.equal(this.entities, that.entities))
    10
    if (!ObjectUtilities.equal(this.entities, that.entities))
    10
    if (!this.sublabels.equals(that.sublabels))
    Differences
    Expression1Expression2Difference
    ObjectUtilities.equal(this.entities,that.entities)this.sublabels.equals(that.sublabels)TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression ObjectUtilities.equal(this.entities,that.entities) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression this.sublabels.equals(that.sublabels) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10
    if (!this.sublabels.equals(that.sublabels))
    11
    return false;
    11
    return false;
    12
    return true;
    12
    return true;
    12
    return super.equals(obj);
    Differences
    Expression1Expression2Difference
    truesuper.equals(obj)TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Super method call return super.equals(obj); cannot be extracted from method
    12
    return super.equals(obj);
    Precondition Violations (13)
    Row Violation
    1Type org.jfree.chart.ChartRenderingInfo does not match with type org.jfree.chart.axis.ExtendedCategoryAxis
    2Type java.awt.geom.Rectangle2D of variable this.chartArea does not match with type java.awt.Paint of variable this.sublabelPaint
    3Type java.awt.geom.Rectangle2D of variable that.chartArea does not match with type java.awt.Paint of variable that.sublabelPaint
    4Expression that.chartArea cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression that.sublabelPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Type java.awt.geom.Rectangle2D of variable that.chartArea does not match with type java.awt.Paint of variable that.sublabelPaint
    7Type org.jfree.util.ObjectUtilities does not match with type org.jfree.util.PaintUtilities
    8Expression ObjectUtilities.equal(this.plotInfo,that.plotInfo) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    9Expression this.sublabelFont.equals(that.sublabelFont) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10Expression ObjectUtilities.equal(this.entities,that.entities) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    11Expression this.sublabels.equals(that.sublabels) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    12Super method call return super.equals(obj); cannot be extracted from method
    13The refactoring of the clones is infeasible, because classes org.jfree.chart.ChartRenderingInfo and org.jfree.chart.axis.ExtendedCategoryAxis do not have a common superclass