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 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/DateAxis.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: 16 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 DateAxis)) {
4
        if (!(obj instanceof MultiplePiePlot)) {
5
            return false;
5
            return false;
6
        }
6
        }
7
        DateAxis that = (DateAxis) obj;
7
        
8
        if (!ObjectUtilities.equal(this.tickUnit, that.tickUnit)
8
MultiplePiePlot that = (MultiplePiePlot) obj;
9
) {
9
        if (this.dataExtractOrder != that.dataExtractOrder) {
10
            return false;
10
            return false;
11
        }
11
        }
12
        if (!ObjectUtilities.equal(this.dateFormatOverride,
12
        if (this.limit != that.limit) {
13
            return false;
13
        
14
        }
14
        that.dateFormatOverride)) {
15
        if (!this.aggregatedItemsKey.equals(that.aggregatedItemsKey)) {
15
            return false;
16
            return false;
16
        }
17
        }
17
        if (!ObjectUtilities.equal(this.tickMarkPosition,
18
        if (!PaintUtilities.equal(this.aggregatedItemsPaint,
18
                that.tickMarkPosition)) {
19
                that.aggregatedItemsPaint)) {
19
            return false;
20
            return false;
20
        }
21
        }
21
        if (!ObjectUtilities.equal(this.timeline, that.timeline)) {
22
        if (!ObjectUtilities.equal(this.pieChart, that.pieChart)) {
22
            return false;
23
            return false;
23
        }
24
        }
24
        if (!super.equals(obj)) {
25
        if (!super.equals(obj)) {
25
            return false;
26
            return false;
26
        }
27
        }
27
        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)5.7
Clones locationClones are in different classes
Number of node comparisons105
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements13
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment4
    Time elapsed for statement mapping (ms)6.5
    Clone typeType 3
    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 MultiplePiePlot))
    Differences
    Expression1Expression2Difference
    org.jfree.chart.axis.DateAxisorg.jfree.chart.plot.MultiplePiePlotSUBCLASS_TYPE_MISMATCH
    3
    if (!(obj instanceof MultiplePiePlot))
    4
    return false;
    4
    return false;
    5
    DateAxis that = (DateAxis)obj;
    5
    DateAxis that = (DateAxis)obj;
    5
    MultiplePiePlot that = (MultiplePiePlot)obj;
    Differences
    Expression1Expression2Difference
    org.jfree.chart.axis.DateAxisorg.jfree.chart.plot.MultiplePiePlotSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.axis.DateAxisorg.jfree.chart.plot.MultiplePiePlotSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.axis.DateAxisorg.jfree.chart.plot.MultiplePiePlotSUBCLASS_TYPE_MISMATCH
    5
    MultiplePiePlot that = (MultiplePiePlot)obj;
                                                                                                              
    6
    if (this.dataExtractOrder != that.dataExtractOrder)
    Preondition Violations
    Unmatched statement if(this.dataExtractOrder != that.dataExtractOrder) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    6
    if (this.dataExtractOrder != that.dataExtractOrder)
                                    
    7
    return false;
    Preondition Violations
    Unmatched return false;
    7
    return false;
                                                                  
    8
    if (this.limit != that.limit)
    Preondition Violations
    Unmatched statement if(this.limit != that.limit) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    8
    if (this.limit != that.limit)
                                    
    9
    return false;
    Preondition Violations
    Unmatched return false;
    9
    return false;
    6
    if (!ObjectUtilities.equal(this.tickUnit, that.tickUnit))
    6
    if (!ObjectUtilities.equal(this.tickUnit, that.tickUnit))
    14
    if (!ObjectUtilities.equal(this.pieChart, that.pieChart))
    Differences
    Expression1Expression2Difference
    tickUnitpieChartVARIABLE_NAME_MISMATCH
    org.jfree.chart.axis.DateTickUnitorg.jfree.chart.JFreeChartVARIABLE_TYPE_MISMATCH
    org.jfree.chart.axis.DateAxisorg.jfree.chart.plot.MultiplePiePlotSUBCLASS_TYPE_MISMATCH
    tickUnitpieChartVARIABLE_NAME_MISMATCH
    org.jfree.chart.axis.DateTickUnitorg.jfree.chart.JFreeChartVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jfree.chart.axis.DateTickUnit of variable this.tickUnit does not match with type org.jfree.chart.JFreeChart of variable this.pieChart
    • Make classes org.jfree.chart.axis.DateTickUnit 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.DateTickUnit of variable that.tickUnit does not match with type org.jfree.chart.JFreeChart of variable that.pieChart
    • Make classes org.jfree.chart.axis.DateTickUnit and org.jfree.chart.JFreeChart extend a common superclass
    14
    if (!ObjectUtilities.equal(this.pieChart, that.pieChart))
    7
    return false;
    15
    return false;
    8
    if (!ObjectUtilities.equal(this.dateFormatOverride, that.dateFormatOverride))
    8
    if (!ObjectUtilities.equal(this.dateFormatOverride, that.dateFormatOverride))
    12
    if (!PaintUtilities.equal(this.aggregatedItemsPaint, that.aggregatedItemsPaint))
    Differences
    Expression1Expression2Difference
    dateFormatOverrideaggregatedItemsPaintVARIABLE_NAME_MISMATCH
    java.text.DateFormatjava.awt.PaintVARIABLE_TYPE_MISMATCH
    org.jfree.chart.axis.DateAxisorg.jfree.chart.plot.MultiplePiePlotSUBCLASS_TYPE_MISMATCH
    dateFormatOverrideaggregatedItemsPaintVARIABLE_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.aggregatedItemsPaint
    • 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.aggregatedItemsPaint 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.aggregatedItemsPaint
    • 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
    12
    if (!PaintUtilities.equal(this.aggregatedItemsPaint, that.aggregatedItemsPaint))
    9
    return false;
    13
    return false;
    10
    if (!ObjectUtilities.equal(this.tickMarkPosition, that.tickMarkPosition))
    10
    if (!ObjectUtilities.equal(this.tickMarkPosition, that.tickMarkPosition))
    16
    if (!super.equals(obj))
    Differences
    Expression1Expression2Difference
    ObjectUtilities.equal(this.tickMarkPosition,that.tickMarkPosition)super.equals(obj)TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression ObjectUtilities.equal(this.tickMarkPosition,that.tickMarkPosition) 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
    16
    if (!super.equals(obj))
    11
    return false;
    17
    return false;
    12
    if (!ObjectUtilities.equal(this.timeline, that.timeline))
    12
    if (!ObjectUtilities.equal(this.timeline, that.timeline))
    10
    if (!this.aggregatedItemsKey.equals(that.aggregatedItemsKey))
    Differences
    Expression1Expression2Difference
    ObjectUtilities.equal(this.timeline,that.timeline)this.aggregatedItemsKey.equals(that.aggregatedItemsKey)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.aggregatedItemsKey.equals(that.aggregatedItemsKey) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10
    if (!this.aggregatedItemsKey.equals(that.aggregatedItemsKey))
    13
    return false;
    11
    return false;
    Precondition Violations (21)
    Row Violation
    1Unmatched statement if(this.dataExtractOrder != that.dataExtractOrder) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Unmatched return false;
    3Unmatched statement if(this.limit != that.limit) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    4Unmatched return false;
    5Type org.jfree.chart.axis.DateTickUnit of variable this.tickUnit does not match with type org.jfree.chart.JFreeChart of variable this.pieChart
    6Expression 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)
    7Expression that.tickUnit cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Expression that.pieChart cannot be parameterized, because it has dependencies to/from statements that will be extracted
    9Type org.jfree.chart.axis.DateTickUnit of variable that.tickUnit does not match with type org.jfree.chart.JFreeChart of variable that.pieChart
    10Type java.text.DateFormat of variable this.dateFormatOverride does not match with type java.awt.Paint of variable this.aggregatedItemsPaint
    11Expression that.dateFormatOverride cannot be parameterized, because it has dependencies to/from statements that will be extracted
    12Expression that.aggregatedItemsPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    13Type java.text.DateFormat of variable that.dateFormatOverride does not match with type java.awt.Paint of variable that.aggregatedItemsPaint
    14Type org.jfree.util.ObjectUtilities does not match with type org.jfree.util.PaintUtilities
    15Expression ObjectUtilities.equal(this.tickMarkPosition,that.tickMarkPosition) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    16Super method call if(!super.equals(obj)) cannot be extracted from method
    17Expression ObjectUtilities.equal(this.timeline,that.timeline) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    18Expression this.aggregatedItemsKey.equals(that.aggregatedItemsKey) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    19Clone fragment #1 returns variables , while Clone fragment #2 returns variables that
    20Not all possible execution flows end in a return statement
    21The refactoring of the clones is infeasible, because classes org.jfree.chart.axis.DateAxis and org.jfree.chart.plot.MultiplePiePlot do not have a common superclass