if (obj == this) { return true; } if (!(obj instanceof DateAxis)) { return false; } DateAxis that = (DateAxis) obj; if (!ObjectUtilities.equal(this.tickUnit, that.tickUnit)) { return false; } if (!ObjectUtilities.equal(this.dateFormatOverride, that.dateFormatOverride)) { return false; } if (!ObjectUtilities.equal(this.tickMarkPosition, that.tickMarkPosition)) { return false; } if (!ObjectUtilities.equal(this.timeline, that.timeline)) { return false; } if (!super.equals(obj)) { return false; } return true;
if (obj == this) { return true; } if (!super.equals(obj)) { return false; } if (!(obj instanceof WaterfallBarRenderer)) { return false; } WaterfallBarRenderer that = (WaterfallBarRenderer) obj; if (!PaintUtilities.equal(this.firstBarPaint, that.firstBarPaint)) { return false; } if (!PaintUtilities.equal(this.lastBarPaint, that.lastBarPaint)) { return false; } if (!PaintUtilities.equal(this.positiveBarPaint, that.positiveBarPaint)) { return false; } if (!PaintUtilities.equal(this.negativeBarPaint, that.negativeBarPaint)) { return false; } return true;
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/axis/DateAxis.java File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/category/WaterfallBarRenderer.java
Method name: boolean equals(Object) Method name: boolean equals(Object)
Number of AST nodes: 16 Number of AST nodes: 16
1
if (obj == this) {
1
if (obj == this) {
2
            return true;
2
            return true;
3
        }
3
        }
4
        if (!super.equals(obj)) {
5
            return false;
6
        }
4
        if (!(obj instanceof DateAxis)) {
7
        if (!(obj instanceof WaterfallBarRenderer)) {
5
            return false;
8
            return false;
6
        }
9
        }
7
        DateAxis that = (DateAxis) obj;
10
        WaterfallBarRenderer that = (WaterfallBarRenderer) obj;
8
        if (!ObjectUtilities.equal(this.tickUnit, that.tickUnit)) {
11
        if (!PaintUtilities.equal(this.firstBarPaint, that.firstBarPaint)) {
9
            return false;
12
            return false;
10
        }
13
        }
11
        if (!ObjectUtilities.equal(this.dateFormatOverride,
14
        if (!PaintUtilities.equal(this.
12
                that.dateFormatOverride)) {
15
lastBarPaint, that.lastBarPaint)) {
13
            return false;
16
            return false;
14
        }
17
        }
15
        if (!ObjectUtilities.equal(this.tickMarkPosition,
18
        if (!PaintUtilities.equal(this.positiveBarPaint,
16
                that.tickMarkPosition)) {
19
                that.positiveBarPaint)) {
17
            return false;
20
            return false;
18
        }
21
        }
19
        if (!ObjectUtilities.equal(this.timeline, that.timeline)) {
22
        if (!PaintUtilities.equal(this.
20
            return false;
23
negativeBarPaint,
21
        }
24
        
22
        if (!super.equals(obj)) {
25
        that.negativeBarPaint)) {
23
            return false;
26
            return false;
24
        }
27
        }
25
        return true;
28
        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)7.3
Clones locationClones are in different classes
Number of node comparisons119
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements16
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)6.6
    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 DateAxis))
    3
    if (!(obj instanceof DateAxis))
    5
    if (!(obj instanceof WaterfallBarRenderer))
    Differences
    Expression1Expression2Difference
    org.jfree.chart.axis.DateAxisorg.jfree.chart.renderer.category.WaterfallBarRendererSUBCLASS_TYPE_MISMATCH
    5
    if (!(obj instanceof WaterfallBarRenderer))
    4
    return false;
    6
    return false;
    5
    DateAxis that = (DateAxis)obj;
    5
    DateAxis that = (DateAxis)obj;
    7
    WaterfallBarRenderer that = (WaterfallBarRenderer)obj;
    Differences
    Expression1Expression2Difference
    org.jfree.chart.axis.DateAxisorg.jfree.chart.renderer.category.WaterfallBarRendererSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.axis.DateAxisorg.jfree.chart.renderer.category.WaterfallBarRendererSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.axis.DateAxisorg.jfree.chart.renderer.category.WaterfallBarRendererSUBCLASS_TYPE_MISMATCH
    7
    WaterfallBarRenderer that = (WaterfallBarRenderer)obj;
    6
    if (!ObjectUtilities.equal(this.tickUnit, that.tickUnit))
    6
    if (!ObjectUtilities.equal(this.tickUnit, that.tickUnit))
    8
    if (!PaintUtilities.equal(this.firstBarPaint, that.firstBarPaint))
    Differences
    Expression1Expression2Difference
    tickUnitfirstBarPaintVARIABLE_NAME_MISMATCH
    org.jfree.chart.axis.DateTickUnitjava.awt.PaintVARIABLE_TYPE_MISMATCH
    org.jfree.chart.axis.DateAxisorg.jfree.chart.renderer.category.WaterfallBarRendererSUBCLASS_TYPE_MISMATCH
    tickUnitfirstBarPaintVARIABLE_NAME_MISMATCH
    org.jfree.chart.axis.DateTickUnitjava.awt.PaintVARIABLE_TYPE_MISMATCH
    org.jfree.util.ObjectUtilitiesorg.jfree.util.PaintUtilitiesVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jfree.chart.axis.DateTickUnit of variable this.tickUnit does not match with type java.awt.Paint of variable this.firstBarPaint
    • Make classes org.jfree.chart.axis.DateTickUnit and java.awt.Paint extend a common superclass
    Expression that.tickUnit cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.firstBarPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type org.jfree.chart.axis.DateTickUnit of variable that.tickUnit does not match with type java.awt.Paint of variable that.firstBarPaint
    • Make classes org.jfree.chart.axis.DateTickUnit 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.firstBarPaint, that.firstBarPaint))
    7
    return false;
    9
    return false;
    8
    if (!ObjectUtilities.equal(this.dateFormatOverride, that.dateFormatOverride))
    8
    if (!ObjectUtilities.equal(this.dateFormatOverride, that.dateFormatOverride))
    10
    if (!PaintUtilities.equal(this.lastBarPaint, that.lastBarPaint))
    Differences
    Expression1Expression2Difference
    dateFormatOverridelastBarPaintVARIABLE_NAME_MISMATCH
    java.text.DateFormatjava.awt.PaintVARIABLE_TYPE_MISMATCH
    org.jfree.chart.axis.DateAxisorg.jfree.chart.renderer.category.WaterfallBarRendererSUBCLASS_TYPE_MISMATCH
    dateFormatOverridelastBarPaintVARIABLE_NAME_MISMATCH
    java.text.DateFormatjava.awt.PaintVARIABLE_TYPE_MISMATCH
    org.jfree.util.ObjectUtilitiesorg.jfree.util.PaintUtilitiesVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.text.DateFormat of variable this.dateFormatOverride does not match with type java.awt.Paint of variable this.lastBarPaint
    • Make classes java.text.DateFormat and java.awt.Paint extend a common superclass
    Expression that.dateFormatOverride cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.lastBarPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type java.text.DateFormat of variable that.dateFormatOverride does not match with type java.awt.Paint of variable that.lastBarPaint
    • Make classes java.text.DateFormat 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
    10
    if (!PaintUtilities.equal(this.lastBarPaint, that.lastBarPaint))
    9
    return false;
    11
    return false;
    10
    if (!ObjectUtilities.equal(this.tickMarkPosition, that.tickMarkPosition))
    10
    if (!ObjectUtilities.equal(this.tickMarkPosition, that.tickMarkPosition))
    12
    if (!PaintUtilities.equal(this.positiveBarPaint, that.positiveBarPaint))
    Differences
    Expression1Expression2Difference
    tickMarkPositionpositiveBarPaintVARIABLE_NAME_MISMATCH
    org.jfree.chart.axis.DateTickMarkPositionjava.awt.PaintVARIABLE_TYPE_MISMATCH
    org.jfree.chart.axis.DateAxisorg.jfree.chart.renderer.category.WaterfallBarRendererSUBCLASS_TYPE_MISMATCH
    tickMarkPositionpositiveBarPaintVARIABLE_NAME_MISMATCH
    org.jfree.chart.axis.DateTickMarkPositionjava.awt.PaintVARIABLE_TYPE_MISMATCH
    org.jfree.util.ObjectUtilitiesorg.jfree.util.PaintUtilitiesVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jfree.chart.axis.DateTickMarkPosition of variable this.tickMarkPosition does not match with type java.awt.Paint of variable this.positiveBarPaint
    • Make classes org.jfree.chart.axis.DateTickMarkPosition and java.awt.Paint extend a common superclass
    Expression that.tickMarkPosition cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.positiveBarPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type org.jfree.chart.axis.DateTickMarkPosition of variable that.tickMarkPosition does not match with type java.awt.Paint of variable that.positiveBarPaint
    • Make classes org.jfree.chart.axis.DateTickMarkPosition 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
    12
    if (!PaintUtilities.equal(this.positiveBarPaint, that.positiveBarPaint))
    11
    return false;
    13
    return false;
    12
    if (!ObjectUtilities.equal(this.timeline, that.timeline))
    12
    if (!ObjectUtilities.equal(this.timeline, that.timeline))
    14
    if (!PaintUtilities.equal(this.negativeBarPaint, that.negativeBarPaint))
    Differences
    Expression1Expression2Difference
    timelinenegativeBarPaintVARIABLE_NAME_MISMATCH
    org.jfree.chart.axis.Timelinejava.awt.PaintVARIABLE_TYPE_MISMATCH
    org.jfree.chart.axis.DateAxisorg.jfree.chart.renderer.category.WaterfallBarRendererSUBCLASS_TYPE_MISMATCH
    timelinenegativeBarPaintVARIABLE_NAME_MISMATCH
    org.jfree.chart.axis.Timelinejava.awt.PaintVARIABLE_TYPE_MISMATCH
    org.jfree.util.ObjectUtilitiesorg.jfree.util.PaintUtilitiesVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jfree.chart.axis.Timeline of variable this.timeline does not match with type java.awt.Paint of variable this.negativeBarPaint
    • Make classes org.jfree.chart.axis.Timeline and java.awt.Paint extend a common superclass
    Expression that.timeline cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.negativeBarPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type org.jfree.chart.axis.Timeline of variable that.timeline does not match with type java.awt.Paint of variable that.negativeBarPaint
    • Make classes org.jfree.chart.axis.Timeline 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
    14
    if (!PaintUtilities.equal(this.negativeBarPaint, that.negativeBarPaint))
    13
    return false;
    15
    return false;
    14
    if (!super.equals(obj))
    14
    if (!super.equals(obj))
    3
    if (!super.equals(obj))
    Preondition Violations
    Super method call if(!super.equals(obj)) cannot be extracted from method
    Super method call if(!super.equals(obj)) cannot be extracted from method
    3
    if (!super.equals(obj))
    15
    return false;
    4
    return false;
    16
    return true;
    16
    return true;
    Precondition Violations (23)
    Row Violation
    1Type org.jfree.chart.axis.DateTickUnit of variable this.tickUnit does not match with type java.awt.Paint of variable this.firstBarPaint
    2Expression that.tickUnit cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression that.firstBarPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Type org.jfree.chart.axis.DateTickUnit of variable that.tickUnit does not match with type java.awt.Paint of variable that.firstBarPaint
    5Type org.jfree.util.ObjectUtilities does not match with type org.jfree.util.PaintUtilities
    6Type java.text.DateFormat of variable this.dateFormatOverride does not match with type java.awt.Paint of variable this.lastBarPaint
    7Expression that.dateFormatOverride cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Expression that.lastBarPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    9Type java.text.DateFormat of variable that.dateFormatOverride does not match with type java.awt.Paint of variable that.lastBarPaint
    10Type org.jfree.util.ObjectUtilities does not match with type org.jfree.util.PaintUtilities
    11Type org.jfree.chart.axis.DateTickMarkPosition of variable this.tickMarkPosition does not match with type java.awt.Paint of variable this.positiveBarPaint
    12Expression that.tickMarkPosition cannot be parameterized, because it has dependencies to/from statements that will be extracted
    13Expression that.positiveBarPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    14Type org.jfree.chart.axis.DateTickMarkPosition of variable that.tickMarkPosition does not match with type java.awt.Paint of variable that.positiveBarPaint
    15Type org.jfree.util.ObjectUtilities does not match with type org.jfree.util.PaintUtilities
    16Type org.jfree.chart.axis.Timeline of variable this.timeline does not match with type java.awt.Paint of variable this.negativeBarPaint
    17Expression that.timeline cannot be parameterized, because it has dependencies to/from statements that will be extracted
    18Expression that.negativeBarPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    19Type org.jfree.chart.axis.Timeline of variable that.timeline does not match with type java.awt.Paint of variable that.negativeBarPaint
    20Type org.jfree.util.ObjectUtilities does not match with type org.jfree.util.PaintUtilities
    21Super method call if(!super.equals(obj)) cannot be extracted from method
    22Super method call if(!super.equals(obj)) cannot be extracted from method
    23The refactoring of the clones is infeasible, because classes org.jfree.chart.axis.DateAxis and org.jfree.chart.renderer.category.WaterfallBarRenderer do not have a common superclass