if (obj == this) { return true; } if (!(obj instanceof NumberAxis)) { return false; } if (!super.equals(obj)) { return false; } NumberAxis that = (NumberAxis) obj; if (this.autoRangeIncludesZero != that.autoRangeIncludesZero) { return false; } if (this.autoRangeStickyZero != that.autoRangeStickyZero) { return false; } if (!ObjectUtilities.equal(this.tickUnit, that.tickUnit)) { return false; } if (!ObjectUtilities.equal(this.numberFormatOverride, that.numberFormatOverride)) { return false; } if (!this.rangeType.equals(that.rangeType)) { return false; } return true;
if (obj == this) { return true; } if (!(obj instanceof MultiplePiePlot)) { return false; } MultiplePiePlot that = (MultiplePiePlot) obj; if (this.dataExtractOrder != that.dataExtractOrder) { return false; } if (this.limit != that.limit) { return false; } if (!this.aggregatedItemsKey.equals(that.aggregatedItemsKey)) { return false; } if (!PaintUtilities.equal(this.aggregatedItemsPaint, that.aggregatedItemsPaint)) { return false; } if (!ObjectUtilities.equal(this.pieChart, that.pieChart)) { return false; } if (!super.equals(obj)) { return false; } return true;
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/axis/NumberAxis.java File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/MultiplePiePlot.java
Method name: boolean equals(Object) Method name: boolean equals(Object)
Number of AST nodes: 18 Number of AST nodes: 18
1
if (obj == this) {
1
if (obj == this) {
2
            return true;
2
            return true;
3
        }
3
        }
4
        if (!(obj instanceof NumberAxis)) {
4
        if (!(obj instanceof MultiplePiePlot)) {
5
            return false;
5
            return false;
6
        }
6
        }
7
        if (!super.equals(obj)) {
7
        
8
            return false;
9
        }
10
        NumberAxis that = (NumberAxis) obj;
11
        if (this.autoRangeIncludesZero != that.autoRangeIncludesZero
8
MultiplePiePlot that = (MultiplePiePlot) obj;
9
        if (this.dataExtractOrder != that.dataExtractOrder) {
10
            return false;
11
        }
12
) {
12
        if (this.limit != that.limit) {
13
            return false;
13
            return false;
14
        }
14
        }
15
        if (this.autoRangeStickyZero != that.autoRangeStickyZero) {
15
        if (!this.aggregatedItemsKey.equals(that.aggregatedItemsKey)) {
16
            return false;
16
            return false;
17
        }
17
        }
18
        if (!ObjectUtilities.equal(this.tickUnit, that.tickUni
18
        if (!PaintUtilities.equal(this.aggregatedItemsPaint,
19
t)) {
19
                that.aggregatedItemsPaint)) {
20
            return false;
20
            return false;
21
        }
21
        }
22
        if (!ObjectUtilities.equal(this.numberFormatOverride,
22
        if (!ObjectUtilities.equal(this.
23
                that.numberFormatOverride)) {
23
pieChart, that.pieChart)) {
24
            return false;
24
            return false;
25
        }
25
        }
26
        if (!this.rangeType.equals(that.rangeType)) {
26
        if (!super.equals(obj)) {
27
            return false;
27
            return false;
28
        }
28
        }
29
        return true;
29
        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)5.6
Clones locationClones are in different classes
Number of node comparisons125
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements17
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)7.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 NumberAxis))
    3
    if (!(obj instanceof NumberAxis))
    3
    if (!(obj instanceof MultiplePiePlot))
    Differences
    Expression1Expression2Difference
    org.jfree.chart.axis.NumberAxisorg.jfree.chart.plot.MultiplePiePlotSUBCLASS_TYPE_MISMATCH
    3
    if (!(obj instanceof MultiplePiePlot))
    4
    return false;
    4
    return false;
                                                                                              
    5
    MultiplePiePlot that = (MultiplePiePlot)obj;
    5
    if (!super.equals(obj))
    5
    if (!super.equals(obj))
    16
    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
    16
    if (!super.equals(obj))
    6
    return false;
    17
    return false;
    7
    NumberAxis that = (NumberAxis)obj;
                                                                          
    8
    if (this.autoRangeIncludesZero != that.autoRangeIncludesZero)
    8
    if (this.autoRangeIncludesZero != that.autoRangeIncludesZero)
    8
    if (this.limit != that.limit)
    Differences
    Expression1Expression2Difference
    autoRangeIncludesZerolimitVARIABLE_NAME_MISMATCH
    booleandoubleVARIABLE_TYPE_MISMATCH
    org.jfree.chart.axis.NumberAxisorg.jfree.chart.plot.MultiplePiePlotSUBCLASS_TYPE_MISMATCH
    autoRangeIncludesZerolimitVARIABLE_NAME_MISMATCH
    booleandoubleVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type boolean of variable this.autoRangeIncludesZero does not match with type double of variable this.limit
    Expression that.autoRangeIncludesZero cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.limit cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type boolean of variable that.autoRangeIncludesZero does not match with type double of variable that.limit
    8
    if (this.limit != that.limit)
    9
    return false;
    9
    return false;
    10
    if (this.autoRangeStickyZero != that.autoRangeStickyZero)
    10
    if (this.autoRangeStickyZero != that.autoRangeStickyZero)
    6
    if (this.dataExtractOrder != that.dataExtractOrder)
    Differences
    Expression1Expression2Difference
    autoRangeStickyZerodataExtractOrderVARIABLE_NAME_MISMATCH
    booleanorg.jfree.util.TableOrderVARIABLE_TYPE_MISMATCH
    org.jfree.chart.axis.NumberAxisorg.jfree.chart.plot.MultiplePiePlotSUBCLASS_TYPE_MISMATCH
    autoRangeStickyZerodataExtractOrderVARIABLE_NAME_MISMATCH
    booleanorg.jfree.util.TableOrderVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type boolean of variable this.autoRangeStickyZero does not match with type org.jfree.util.TableOrder of variable this.dataExtractOrder
    Expression that.autoRangeStickyZero cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.dataExtractOrder cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type boolean of variable that.autoRangeStickyZero does not match with type org.jfree.util.TableOrder of variable that.dataExtractOrder
    6
    if (this.dataExtractOrder != that.dataExtractOrder)
    11
    return false;
    7
    return false;
    12
    if (!ObjectUtilities.equal(this.tickUnit, that.tickUnit))
    12
    if (!ObjectUtilities.equal(this.tickUnit, that.tickUnit))
    14
    if (!ObjectUtilities.equal(this.pieChart, that.pieChart))
    Differences
    Expression1Expression2Difference
    tickUnitpieChartVARIABLE_NAME_MISMATCH
    org.jfree.chart.axis.NumberTickUnitorg.jfree.chart.JFreeChartVARIABLE_TYPE_MISMATCH
    org.jfree.chart.axis.NumberAxisorg.jfree.chart.plot.MultiplePiePlotSUBCLASS_TYPE_MISMATCH
    tickUnitpieChartVARIABLE_NAME_MISMATCH
    org.jfree.chart.axis.NumberTickUnitorg.jfree.chart.JFreeChartVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jfree.chart.axis.NumberTickUnit of variable this.tickUnit does not match with type org.jfree.chart.JFreeChart of variable this.pieChart
    • Make classes org.jfree.chart.axis.NumberTickUnit and org.jfree.chart.JFreeChart extend a common superclass
    Expression that.tickUnit cannot be unified with expression that.pieChart , because common superclass type java.io.Serializable cannot be passed as an argument to public static boolean equal(java.lang.Object, java.lang.Object)
    Expression that.tickUnit cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.pieChart cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type org.jfree.chart.axis.NumberTickUnit of variable that.tickUnit does not match with type org.jfree.chart.JFreeChart of variable that.pieChart
    • Make classes org.jfree.chart.axis.NumberTickUnit and org.jfree.chart.JFreeChart extend a common superclass
    14
    if (!ObjectUtilities.equal(this.pieChart, that.pieChart))
    13
    return false;
    15
    return false;
    14
    if (!ObjectUtilities.equal(this.numberFormatOverride, that.numberFormatOverride))
    14
    if (!ObjectUtilities.equal(this.numberFormatOverride, that.numberFormatOverride))
    12
    if (!PaintUtilities.equal(this.aggregatedItemsPaint, that.aggregatedItemsPaint))
    Differences
    Expression1Expression2Difference
    numberFormatOverrideaggregatedItemsPaintVARIABLE_NAME_MISMATCH
    java.text.NumberFormatjava.awt.PaintVARIABLE_TYPE_MISMATCH
    org.jfree.chart.axis.NumberAxisorg.jfree.chart.plot.MultiplePiePlotSUBCLASS_TYPE_MISMATCH
    numberFormatOverrideaggregatedItemsPaintVARIABLE_NAME_MISMATCH
    java.text.NumberFormatjava.awt.PaintVARIABLE_TYPE_MISMATCH
    org.jfree.util.ObjectUtilitiesorg.jfree.util.PaintUtilitiesVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.text.NumberFormat of variable this.numberFormatOverride does not match with type java.awt.Paint of variable this.aggregatedItemsPaint
    • Make classes java.text.NumberFormat and java.awt.Paint extend a common superclass
    Expression that.numberFormatOverride cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.aggregatedItemsPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type java.text.NumberFormat of variable that.numberFormatOverride does not match with type java.awt.Paint of variable that.aggregatedItemsPaint
    • Make classes java.text.NumberFormat 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.aggregatedItemsPaint, that.aggregatedItemsPaint))
    15
    return false;
    13
    return false;
    16
    if (!this.rangeType.equals(that.rangeType))
    16
    if (!this.rangeType.equals(that.rangeType))
    10
    if (!this.aggregatedItemsKey.equals(that.aggregatedItemsKey))
    Differences
    Expression1Expression2Difference
    org.jfree.chart.axis.NumberAxisorg.jfree.chart.plot.MultiplePiePlotSUBCLASS_TYPE_MISMATCH
    rangeTypeaggregatedItemsKeyVARIABLE_NAME_MISMATCH
    org.jfree.data.RangeTypejava.lang.ComparableVARIABLE_TYPE_MISMATCH
    rangeTypeaggregatedItemsKeyVARIABLE_NAME_MISMATCH
    org.jfree.data.RangeTypejava.lang.ComparableVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Expression that.rangeType cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.aggregatedItemsKey cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type org.jfree.data.RangeType of variable that.rangeType does not match with type java.lang.Comparable of variable that.aggregatedItemsKey
    • Make classes org.jfree.data.RangeType and java.lang.Comparable extend a common superclass
    Type org.jfree.data.RangeType of variable this.rangeType does not match with type java.lang.Comparable of variable this.aggregatedItemsKey
    • Make classes org.jfree.data.RangeType and java.lang.Comparable extend a common superclass
    10
    if (!this.aggregatedItemsKey.equals(that.aggregatedItemsKey))
    17
    return false;
    11
    return false;
    18
    return true;
    18
    return true;
    Precondition Violations (25)
    Row Violation
    1Super method call if(!super.equals(obj)) cannot be extracted from method
    2Super method call if(!super.equals(obj)) cannot be extracted from method
    3Type boolean of variable this.autoRangeIncludesZero does not match with type double of variable this.limit
    4Expression that.autoRangeIncludesZero cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression that.limit cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Type boolean of variable that.autoRangeIncludesZero does not match with type double of variable that.limit
    7Type boolean of variable this.autoRangeStickyZero does not match with type org.jfree.util.TableOrder of variable this.dataExtractOrder
    8Expression that.autoRangeStickyZero cannot be parameterized, because it has dependencies to/from statements that will be extracted
    9Expression that.dataExtractOrder cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10Type boolean of variable that.autoRangeStickyZero does not match with type org.jfree.util.TableOrder of variable that.dataExtractOrder
    11Type org.jfree.chart.axis.NumberTickUnit of variable this.tickUnit does not match with type org.jfree.chart.JFreeChart of variable this.pieChart
    12Expression that.tickUnit cannot be unified with expression that.pieChart , because common superclass type java.io.Serializable cannot be passed as an argument to public static boolean equal(java.lang.Object, java.lang.Object)
    13Expression that.tickUnit cannot be parameterized, because it has dependencies to/from statements that will be extracted
    14Expression that.pieChart cannot be parameterized, because it has dependencies to/from statements that will be extracted
    15Type org.jfree.chart.axis.NumberTickUnit of variable that.tickUnit does not match with type org.jfree.chart.JFreeChart of variable that.pieChart
    16Type java.text.NumberFormat of variable this.numberFormatOverride does not match with type java.awt.Paint of variable this.aggregatedItemsPaint
    17Expression that.numberFormatOverride cannot be parameterized, because it has dependencies to/from statements that will be extracted
    18Expression that.aggregatedItemsPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    19Type java.text.NumberFormat of variable that.numberFormatOverride does not match with type java.awt.Paint of variable that.aggregatedItemsPaint
    20Type org.jfree.util.ObjectUtilities does not match with type org.jfree.util.PaintUtilities
    21Expression that.rangeType cannot be parameterized, because it has dependencies to/from statements that will be extracted
    22Expression that.aggregatedItemsKey cannot be parameterized, because it has dependencies to/from statements that will be extracted
    23Type org.jfree.data.RangeType of variable that.rangeType does not match with type java.lang.Comparable of variable that.aggregatedItemsKey
    24Type org.jfree.data.RangeType of variable this.rangeType does not match with type java.lang.Comparable of variable this.aggregatedItemsKey
    25The refactoring of the clones is infeasible, because classes org.jfree.chart.axis.NumberAxis and org.jfree.chart.plot.MultiplePiePlot do not have a common superclass