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 (!(obj instanceof MeterInterval)) { return false; } MeterInterval that = (MeterInterval) obj; if (!this.label.equals(that.label)) { return false; } if (!this.range.equals(that.range)) { return false; } if (!PaintUtilities.equal(this.outlinePaint, that.outlinePaint)) { return false; } if (!ObjectUtilities.equal(this.outlineStroke, that.outlineStroke)) { return false; } if (!PaintUtilities.equal(this.backgroundPaint, that.backgroundPaint)) { 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/plot/MeterInterval.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 (!(obj instanceof DateAxis)) {
4
        if (!(obj instanceof MeterInterval)) {
5
            return false;
5
            return false;
6
        }
6
        }
7
        DateAxis that = (DateAxis) obj;
7
        MeterInterval that = (MeterInterval) obj;
8
        if (!ObjectUtilities.equal(this.tickUnit, that.tickUnit)) {
8
        if (!this.label.equals(that.label)) {
9
            return false;
9
            return false;
10
        }
10
        }
11
        if (!ObjectUtilities.equal(this.dateFormatOverride,
11
        if (!
12
                that.dateFormatOverride)) {
12
this.range.equals(that.range)) {
13
            return false;
13
            return false;
14
        }
14
        }
15
        if (!ObjectUtilities.equal(this.tickMarkPosition,
15
        if (!PaintUtilities.equal(this.
16
                that.tickMarkPosition)) {
16
outlinePaint, that.outlinePaint)) {
17
            return false;
17
            return false;
18
        }
18
        }
19
        if (!ObjectUtilities.equal(this.timeline, that.timeline)) {
19
        if (!ObjectUtilities.equal(this.outlineStroke, that.outlineStroke)) {
20
            return false;
20
            return false;
21
        }
21
        }
22
        if (!super.equals(obj)) {
22
        if (!PaintUtilities.equal(this.backgroundPaint, that.backgroundPaint)) {
23
            return false;
23
            return false;
24
        }
24
        }
25
        return true;
25
        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)4.9
Clones locationClones are in different classes
Number of node comparisons119
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements15
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)9.1
    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))
    3
    if (!(obj instanceof MeterInterval))
    Differences
    Expression1Expression2Difference
    org.jfree.chart.axis.DateAxisorg.jfree.chart.plot.MeterIntervalVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jfree.chart.axis.DateAxis does not match with type org.jfree.chart.plot.MeterInterval
    • Make classes org.jfree.chart.axis.DateAxis and org.jfree.chart.plot.MeterInterval extend a common superclass
    3
    if (!(obj instanceof MeterInterval))
    4
    return false;
    4
    return false;
                                                                                      
    5
    MeterInterval that = (MeterInterval)obj;
    5
    DateAxis that = (DateAxis)obj;
                                                                  
    6
    if (!ObjectUtilities.equal(this.tickUnit, that.tickUnit))
    6
    if (!ObjectUtilities.equal(this.tickUnit, that.tickUnit))
    12
    if (!ObjectUtilities.equal(this.outlineStroke, that.outlineStroke))
    Differences
    Expression1Expression2Difference
    tickUnitoutlineStrokeVARIABLE_NAME_MISMATCH
    org.jfree.chart.axis.DateTickUnitjava.awt.StrokeVARIABLE_TYPE_MISMATCH
    org.jfree.chart.axis.DateAxisorg.jfree.chart.plot.MeterIntervalVARIABLE_TYPE_MISMATCH
    tickUnitoutlineStrokeVARIABLE_NAME_MISMATCH
    org.jfree.chart.axis.DateTickUnitjava.awt.StrokeVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jfree.chart.axis.DateTickUnit of variable this.tickUnit does not match with type java.awt.Stroke of variable this.outlineStroke
    • Make classes org.jfree.chart.axis.DateTickUnit and java.awt.Stroke extend a common superclass
    Type org.jfree.chart.axis.DateTickUnit of variable that.tickUnit does not match with type java.awt.Stroke of variable that.outlineStroke
    • Make classes org.jfree.chart.axis.DateAxis and org.jfree.chart.plot.MeterInterval extend a common superclass
    Expression that.tickUnit cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.outlineStroke 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.Stroke of variable that.outlineStroke
    • Make classes org.jfree.chart.axis.DateTickUnit and java.awt.Stroke extend a common superclass
    12
    if (!ObjectUtilities.equal(this.outlineStroke, that.outlineStroke))
    7
    return false;
    13
    return false;
    8
    if (!ObjectUtilities.equal(this.dateFormatOverride, that.dateFormatOverride))
    8
    if (!ObjectUtilities.equal(this.dateFormatOverride, that.dateFormatOverride))
    10
    if (!PaintUtilities.equal(this.outlinePaint, that.outlinePaint))
    Differences
    Expression1Expression2Difference
    dateFormatOverrideoutlinePaintVARIABLE_NAME_MISMATCH
    java.text.DateFormatjava.awt.PaintVARIABLE_TYPE_MISMATCH
    org.jfree.chart.axis.DateAxisorg.jfree.chart.plot.MeterIntervalVARIABLE_TYPE_MISMATCH
    dateFormatOverrideoutlinePaintVARIABLE_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.outlinePaint
    • Make classes java.text.DateFormat and java.awt.Paint extend a common superclass
    Type java.text.DateFormat of variable that.dateFormatOverride does not match with type java.awt.Paint of variable that.outlinePaint
    • Make classes org.jfree.chart.axis.DateAxis and org.jfree.chart.plot.MeterInterval extend a common superclass
    Expression that.dateFormatOverride cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.outlinePaint 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.outlinePaint
    • 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.outlinePaint, that.outlinePaint))
    9
    return false;
    11
    return false;
    10
    if (!ObjectUtilities.equal(this.tickMarkPosition, that.tickMarkPosition))
    10
    if (!ObjectUtilities.equal(this.tickMarkPosition, that.tickMarkPosition))
    14
    if (!PaintUtilities.equal(this.backgroundPaint, that.backgroundPaint))
    Differences
    Expression1Expression2Difference
    tickMarkPositionbackgroundPaintVARIABLE_NAME_MISMATCH
    org.jfree.chart.axis.DateTickMarkPositionjava.awt.PaintVARIABLE_TYPE_MISMATCH
    org.jfree.chart.axis.DateAxisorg.jfree.chart.plot.MeterIntervalVARIABLE_TYPE_MISMATCH
    tickMarkPositionbackgroundPaintVARIABLE_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.backgroundPaint
    • Make classes org.jfree.chart.axis.DateTickMarkPosition and java.awt.Paint extend a common superclass
    Type org.jfree.chart.axis.DateTickMarkPosition of variable that.tickMarkPosition does not match with type java.awt.Paint of variable that.backgroundPaint
    • Make classes org.jfree.chart.axis.DateAxis and org.jfree.chart.plot.MeterInterval extend a common superclass
    Expression that.tickMarkPosition cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.backgroundPaint 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.backgroundPaint
    • 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
    14
    if (!PaintUtilities.equal(this.backgroundPaint, that.backgroundPaint))
    11
    return false;
    15
    return false;
    12
    if (!ObjectUtilities.equal(this.timeline, that.timeline))
    12
    if (!ObjectUtilities.equal(this.timeline, that.timeline))
    8
    if (!this.range.equals(that.range))
    Differences
    Expression1Expression2Difference
    ObjectUtilities.equal(this.timeline,that.timeline)this.range.equals(that.range)TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression ObjectUtilities.equal(this.timeline,that.timeline) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression this.range.equals(that.range) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8
    if (!this.range.equals(that.range))
    13
    return false;
    9
    return false;
    14
    if (!super.equals(obj))
    14
    if (!super.equals(obj))
    6
    if (!this.label.equals(that.label))
    Differences
    Expression1Expression2Difference
    super.equals(obj)this.label.equals(that.label)TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression this.label.equals(that.label) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Super method call if(!super.equals(obj)) cannot be extracted from method
    6
    if (!this.label.equals(that.label))
    15
    return false;
    7
    return false;
    16
    return true;
    16
    return true;
    Precondition Violations (23)
    Row Violation
    1Type org.jfree.chart.axis.DateAxis does not match with type org.jfree.chart.plot.MeterInterval
    2Type org.jfree.chart.axis.DateTickUnit of variable this.tickUnit does not match with type java.awt.Stroke of variable this.outlineStroke
    3Type org.jfree.chart.axis.DateTickUnit of variable that.tickUnit does not match with type java.awt.Stroke of variable that.outlineStroke
    4Expression that.tickUnit cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression that.outlineStroke cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Type org.jfree.chart.axis.DateTickUnit of variable that.tickUnit does not match with type java.awt.Stroke of variable that.outlineStroke
    7Type java.text.DateFormat of variable this.dateFormatOverride does not match with type java.awt.Paint of variable this.outlinePaint
    8Type java.text.DateFormat of variable that.dateFormatOverride does not match with type java.awt.Paint of variable that.outlinePaint
    9Expression that.dateFormatOverride cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10Expression that.outlinePaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    11Type java.text.DateFormat of variable that.dateFormatOverride does not match with type java.awt.Paint of variable that.outlinePaint
    12Type org.jfree.util.ObjectUtilities does not match with type org.jfree.util.PaintUtilities
    13Type org.jfree.chart.axis.DateTickMarkPosition of variable this.tickMarkPosition does not match with type java.awt.Paint of variable this.backgroundPaint
    14Type org.jfree.chart.axis.DateTickMarkPosition of variable that.tickMarkPosition does not match with type java.awt.Paint of variable that.backgroundPaint
    15Expression that.tickMarkPosition cannot be parameterized, because it has dependencies to/from statements that will be extracted
    16Expression that.backgroundPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    17Type org.jfree.chart.axis.DateTickMarkPosition of variable that.tickMarkPosition does not match with type java.awt.Paint of variable that.backgroundPaint
    18Type org.jfree.util.ObjectUtilities does not match with type org.jfree.util.PaintUtilities
    19Expression ObjectUtilities.equal(this.timeline,that.timeline) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    20Expression this.range.equals(that.range) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    21Expression this.label.equals(that.label) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    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.plot.MeterInterval do not have a common superclass