if (this == obj) { return true; } if (!(obj instanceof RingPlot)) { return false; } RingPlot that = (RingPlot) obj; if (this.separatorsVisible != that.separatorsVisible) { return false; } if (!ObjectUtilities.equal(this.separatorStroke, that.separatorStroke)) { return false; } if (!PaintUtilities.equal(this.separatorPaint, that.separatorPaint)) { return false; } if (this.innerSeparatorExtension != that.innerSeparatorExtension) { return false; } if (this.outerSeparatorExtension != that.outerSeparatorExtension) { return false; } if (this.sectionDepth != that.sectionDepth) { return false; } return super.equals(obj);
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/RingPlot.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 (this == obj) {
1
if (obj == this) {
2
            return true;
2
            return true;
3
        }
3
        }
4
        if (!(obj instanceof RingPlot)) {
4
        if (!(obj instanceof DialTextAnnotation)) {
5
            return false;
5
            return false;
6
        }
6
        }
7
        RingPlot that = (RingPlot) obj;
7
        DialTextAnnotation that = (DialTextAnnotation) obj;
8
        if (this.separatorsVisible != that.separatorsVisible) {
8
        if (!this.label.equals(that.label)) {
9
            return false;
9
            return false;
10
        }
10
        }
11
        if (!ObjectUtilities.equal(this.separatorStroke, 
11
        if (!
12
                that.separatorStroke)) {
12
this.font.equals(that.font)) {
13
            return false;
13
            return false;
14
        }
14
        }
15
        if (!PaintUtilities.equal(this.separatorPaint, that.separatorPaint)) {
15
        if (!PaintUtilities.equal(this.paint, that.paint)) {
16
            return false;
16
            return false;
17
        }
17
        }
18
        if (this.innerSeparatorExtension != that.innerSeparatorExtension) {
18
        if (this.radius != that.radius) {
19
            return false;
19
            return false;
20
        }
20
        }
21
        if (this.outerSeparatorExtension != that.outerSeparatorExtension) {
21
        if (this.angle != that.angle) {
22
            return false;
22
            return false;
23
        }
23
        }
24
        if (this.sectionDepth != that.sectionDepth) {
24
        if (!this.anchor.equals(that.anchor)) {
25
            return false;
25
            return false;
26
        }
26
        }
27
        return super.equals(obj);
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.4
Clones locationClones are in different classes
Number of node comparisons101
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements11
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)5.8
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    3
    if (!(obj instanceof RingPlot))
    3
    if (!(obj instanceof RingPlot))
    3
    if (!(obj instanceof DialTextAnnotation))
    Differences
    Expression1Expression2Difference
    org.jfree.chart.plot.RingPlotorg.jfree.chart.plot.dial.DialTextAnnotationSUBCLASS_TYPE_MISMATCH
    3
    if (!(obj instanceof DialTextAnnotation))
    4
    return false;
    4
    return false;
    5
    RingPlot that = (RingPlot)obj;
    5
    RingPlot that = (RingPlot)obj;
    5
    DialTextAnnotation that = (DialTextAnnotation)obj;
    Differences
    Expression1Expression2Difference
    org.jfree.chart.plot.RingPlotorg.jfree.chart.plot.dial.DialTextAnnotationSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.plot.RingPlotorg.jfree.chart.plot.dial.DialTextAnnotationSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.plot.RingPlotorg.jfree.chart.plot.dial.DialTextAnnotationSUBCLASS_TYPE_MISMATCH
    5
    DialTextAnnotation that = (DialTextAnnotation)obj;
                                                                              
    6
    if (!this.label.equals(that.label))
    Preondition Violations
    Unmatched statement if(!this.label.equals(that.label)) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    6
    if (!this.label.equals(that.label))
                                    
    7
    return false;
    Preondition Violations
    Unmatched return false;
    7
    return false;
    6
    if (this.separatorsVisible != that.separatorsVisible)
    6
    if (this.separatorsVisible != that.separatorsVisible)
    12
    if (this.radius != that.radius)
    Differences
    Expression1Expression2Difference
    separatorsVisibleradiusVARIABLE_NAME_MISMATCH
    booleandoubleVARIABLE_TYPE_MISMATCH
    org.jfree.chart.plot.RingPlotorg.jfree.chart.plot.dial.DialTextAnnotationSUBCLASS_TYPE_MISMATCH
    separatorsVisibleradiusVARIABLE_NAME_MISMATCH
    booleandoubleVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type boolean of variable this.separatorsVisible does not match with type double of variable this.radius
    Expression that.separatorsVisible 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 boolean of variable that.separatorsVisible does not match with type double of variable that.radius
    12
    if (this.radius != that.radius)
    7
    return false;
    13
    return false;
    8
    if (!ObjectUtilities.equal(this.separatorStroke, that.separatorStroke))
    8
    if (!ObjectUtilities.equal(this.separatorStroke, that.separatorStroke))
    10
    if (!PaintUtilities.equal(this.paint, that.paint))
    Differences
    Expression1Expression2Difference
    separatorStrokepaintVARIABLE_NAME_MISMATCH
    java.awt.Strokejava.awt.PaintVARIABLE_TYPE_MISMATCH
    org.jfree.chart.plot.RingPlotorg.jfree.chart.plot.dial.DialTextAnnotationSUBCLASS_TYPE_MISMATCH
    separatorStrokepaintVARIABLE_NAME_MISMATCH
    java.awt.Strokejava.awt.PaintVARIABLE_TYPE_MISMATCH
    org.jfree.util.ObjectUtilitiesorg.jfree.util.PaintUtilitiesVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.awt.Stroke of variable this.separatorStroke does not match with type java.awt.Paint of variable this.paint
    • Make classes java.awt.Stroke and java.awt.Paint extend a common superclass
    Expression that.separatorStroke 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
    Type java.awt.Stroke of variable that.separatorStroke does not match with type java.awt.Paint of variable that.paint
    • Make classes java.awt.Stroke 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.paint, that.paint))
    9
    return false;
    11
    return false;
    10
    if (!PaintUtilities.equal(this.separatorPaint, that.separatorPaint))
    10
    if (!PaintUtilities.equal(this.separatorPaint, that.separatorPaint))
    8
    if (!this.font.equals(that.font))
    Differences
    Expression1Expression2Difference
    PaintUtilities.equal(this.separatorPaint,that.separatorPaint)this.font.equals(that.font)TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression PaintUtilities.equal(this.separatorPaint,that.separatorPaint) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression this.font.equals(that.font) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8
    if (!this.font.equals(that.font))
    11
    return false;
    9
    return false;
    12
    if (this.innerSeparatorExtension != that.innerSeparatorExtension)
    12
    if (this.innerSeparatorExtension != that.innerSeparatorExtension)
    14
    if (this.angle != that.angle)
    Differences
    Expression1Expression2Difference
    innerSeparatorExtensionangleVARIABLE_NAME_MISMATCH
    org.jfree.chart.plot.RingPlotorg.jfree.chart.plot.dial.DialTextAnnotationSUBCLASS_TYPE_MISMATCH
    innerSeparatorExtensionangleVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression that.innerSeparatorExtension 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)
    13
    return false;
    15
    return false;
    Precondition Violations (17)
    Row Violation
    1Unmatched statement if(!this.label.equals(that.label)) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Unmatched return false;
    3Type boolean of variable this.separatorsVisible does not match with type double of variable this.radius
    4Expression that.separatorsVisible cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression that.radius cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Type boolean of variable that.separatorsVisible does not match with type double of variable that.radius
    7Type java.awt.Stroke of variable this.separatorStroke does not match with type java.awt.Paint of variable this.paint
    8Expression that.separatorStroke cannot be parameterized, because it has dependencies to/from statements that will be extracted
    9Expression that.paint cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10Type java.awt.Stroke of variable that.separatorStroke does not match with type java.awt.Paint of variable that.paint
    11Type org.jfree.util.ObjectUtilities does not match with type org.jfree.util.PaintUtilities
    12Expression PaintUtilities.equal(this.separatorPaint,that.separatorPaint) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    13Expression this.font.equals(that.font) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    14Expression that.innerSeparatorExtension cannot be parameterized, because it has dependencies to/from statements that will be extracted
    15Expression that.angle cannot be parameterized, because it has dependencies to/from statements that will be extracted
    16Clone fragment #1 returns variable that with type org.jfree.chart.plot.RingPlot , while Clone fragment #2 returns variable that with type org.jfree.chart.plot.dial.DialTextAnnotation
    17Not all possible execution flows end in a return statement