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;
if (obj == this) { return true; } if (!(obj instanceof DialTextAnnotation)) { return false; } DialTextAnnotation that = (DialTextAnnotation) obj; if (!this.label.equals(that.label)) { return false; } if (!this.font.equals(that.font)) { return false; } if (!PaintUtilities.equal(this.paint, that.paint)) { return false; } if (this.radius != that.radius) { return false; } if (this.angle != that.angle) { return false; } if (!this.anchor.equals(that.anchor)) { return false; } return super.equals(obj);
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/MultiplePiePlot.java File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/dial/DialTextAnnotation.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 MultiplePiePlot)) {
4
        if (!(obj instanceof DialTextAnnotation)) {
5
            return false;
5
            return false;
6
        }
6
        }
7
        MultiplePiePlot that = (MultiplePiePlot) obj;
7
        DialTextAnnotation that = (DialTextAnnotation) obj;
8
        if (this.dataExtractOrder != that.dataExtractOrder) {
8
        if (!this.label.equals(that.label)) {
9
            return false;
9
            return false;
10
        }
10
        }
11
        if (this.limit != that.limit) {
11
        if (!this.font.equals(that.font)) {
12
            return false;
12
            return false;
13
        }
13
        }
14
        if (!this.aggregatedItemsKey.equals(that.aggregatedItemsKey)) {
14
        if (!PaintUtilities.equal(this.paint, that.paint)) {
15
            return false;
15
            return false;
16
        }
16
        }
17
        if (!PaintUtilities.equal(this.aggregatedItemsPaint,
17
        if (
18
                that.aggregatedItemsPaint)) {
18
this.radius != that.radius) {
19
            return false;
19
            return false;
20
        }
20
        }
21
        if (!ObjectUtilities.equal(this.pieChart, that.pieChart)) {
21
        if (this.angle != that.angle) {
22
            return false;
22
            return false;
23
        }
23
        }
24
        if (!super.equals(obj)) {
24
        if (!this.anchor.equals(that.anchor)) {
25
            return false;
25
            return false;
26
        }
26
        }
27
        return true;
27
        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)5.5
Clones locationClones are in different classes
Number of node comparisons125
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements18
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)7.3
    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 MultiplePiePlot))
    3
    if (!(obj instanceof MultiplePiePlot))
    3
    if (!(obj instanceof DialTextAnnotation))
    Differences
    Expression1Expression2Difference
    org.jfree.chart.plot.MultiplePiePlotorg.jfree.chart.plot.dial.DialTextAnnotationSUBCLASS_TYPE_MISMATCH
    3
    if (!(obj instanceof DialTextAnnotation))
    4
    return false;
    4
    return false;
    5
    MultiplePiePlot that = (MultiplePiePlot)obj;
    5
    MultiplePiePlot that = (MultiplePiePlot)obj;
    5
    DialTextAnnotation that = (DialTextAnnotation)obj;
    Differences
    Expression1Expression2Difference
    org.jfree.chart.plot.MultiplePiePlotorg.jfree.chart.plot.dial.DialTextAnnotationSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.plot.MultiplePiePlotorg.jfree.chart.plot.dial.DialTextAnnotationSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.plot.MultiplePiePlotorg.jfree.chart.plot.dial.DialTextAnnotationSUBCLASS_TYPE_MISMATCH
    5
    DialTextAnnotation that = (DialTextAnnotation)obj;
    6
    if (this.dataExtractOrder != that.dataExtractOrder)
    6
    if (this.dataExtractOrder != that.dataExtractOrder)
    12
    if (this.radius != that.radius)
    Differences
    Expression1Expression2Difference
    dataExtractOrderradiusVARIABLE_NAME_MISMATCH
    org.jfree.util.TableOrderdoubleVARIABLE_TYPE_MISMATCH
    org.jfree.chart.plot.MultiplePiePlotorg.jfree.chart.plot.dial.DialTextAnnotationSUBCLASS_TYPE_MISMATCH
    dataExtractOrderradiusVARIABLE_NAME_MISMATCH
    org.jfree.util.TableOrderdoubleVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jfree.util.TableOrder of variable this.dataExtractOrder does not match with type double of variable this.radius
    Expression that.dataExtractOrder cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.radius cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type org.jfree.util.TableOrder of variable that.dataExtractOrder does not match with type double of variable that.radius
    12
    if (this.radius != that.radius)
    7
    return false;
    13
    return false;
    8
    if (this.limit != that.limit)
    8
    if (this.limit != that.limit)
    14
    if (this.angle != that.angle)
    Differences
    Expression1Expression2Difference
    limitangleVARIABLE_NAME_MISMATCH
    org.jfree.chart.plot.MultiplePiePlotorg.jfree.chart.plot.dial.DialTextAnnotationSUBCLASS_TYPE_MISMATCH
    limitangleVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression that.limit cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.angle cannot be parameterized, because it has dependencies to/from statements that will be extracted
    14
    if (this.angle != that.angle)
    9
    return false;
    15
    return false;
    10
    if (!this.aggregatedItemsKey.equals(that.aggregatedItemsKey))
    10
    if (!this.aggregatedItemsKey.equals(that.aggregatedItemsKey))
    8
    if (!this.font.equals(that.font))
    Differences
    Expression1Expression2Difference
    org.jfree.chart.plot.MultiplePiePlotorg.jfree.chart.plot.dial.DialTextAnnotationSUBCLASS_TYPE_MISMATCH
    aggregatedItemsKeyfontVARIABLE_NAME_MISMATCH
    java.lang.Comparablejava.awt.FontVARIABLE_TYPE_MISMATCH
    aggregatedItemsKeyfontVARIABLE_NAME_MISMATCH
    java.lang.Comparablejava.awt.FontVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Expression that.aggregatedItemsKey cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.font cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type java.lang.Comparable of variable that.aggregatedItemsKey does not match with type java.awt.Font of variable that.font
    • Make classes java.lang.Comparable and java.awt.Font extend a common superclass
    Type java.lang.Comparable of variable this.aggregatedItemsKey does not match with type java.awt.Font of variable this.font
    • Make classes java.lang.Comparable and java.awt.Font extend a common superclass
    8
    if (!this.font.equals(that.font))
    11
    return false;
    9
    return false;
    12
    if (!PaintUtilities.equal(this.aggregatedItemsPaint, that.aggregatedItemsPaint))
    12
    if (!PaintUtilities.equal(this.aggregatedItemsPaint, that.aggregatedItemsPaint))
    10
    if (!PaintUtilities.equal(this.paint, that.paint))
    Differences
    Expression1Expression2Difference
    aggregatedItemsPaintpaintVARIABLE_NAME_MISMATCH
    org.jfree.chart.plot.MultiplePiePlotorg.jfree.chart.plot.dial.DialTextAnnotationSUBCLASS_TYPE_MISMATCH
    aggregatedItemsPaintpaintVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression that.aggregatedItemsPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.paint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10
    if (!PaintUtilities.equal(this.paint, that.paint))
    13
    return false;
    11
    return false;
    14
    if (!ObjectUtilities.equal(this.pieChart, that.pieChart))
    14
    if (!ObjectUtilities.equal(this.pieChart, that.pieChart))
    16
    if (!this.anchor.equals(that.anchor))
    Differences
    Expression1Expression2Difference
    ObjectUtilities.equal(this.pieChart,that.pieChart)this.anchor.equals(that.anchor)TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression ObjectUtilities.equal(this.pieChart,that.pieChart) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression this.anchor.equals(that.anchor) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    16
    if (!this.anchor.equals(that.anchor))
    15
    return false;
    17
    return false;
    16
    if (!super.equals(obj))
    16
    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))
    17
    return false;
    7
    return false;
    18
    return true;
    18
    return true;
    18
    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
    18
    return super.equals(obj);
    Precondition Violations (18)
    Row Violation
    1Type org.jfree.util.TableOrder of variable this.dataExtractOrder does not match with type double of variable this.radius
    2Expression that.dataExtractOrder cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression that.radius cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Type org.jfree.util.TableOrder of variable that.dataExtractOrder does not match with type double of variable that.radius
    5Expression that.limit cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression that.angle cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression that.aggregatedItemsKey cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Expression that.font cannot be parameterized, because it has dependencies to/from statements that will be extracted
    9Type java.lang.Comparable of variable that.aggregatedItemsKey does not match with type java.awt.Font of variable that.font
    10Type java.lang.Comparable of variable this.aggregatedItemsKey does not match with type java.awt.Font of variable this.font
    11Expression that.aggregatedItemsPaint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    12Expression that.paint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    13Expression ObjectUtilities.equal(this.pieChart,that.pieChart) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    14Expression this.anchor.equals(that.anchor) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    15Expression this.label.equals(that.label) 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
    17Super method call return super.equals(obj); cannot be extracted from method
    18The refactoring of the clones is infeasible, because classes org.jfree.chart.plot.MultiplePiePlot and org.jfree.chart.plot.dial.DialTextAnnotation do not have a common superclass