if (obj == this) { return true; } if (!(obj instanceof DialBackground)) { return false; } DialBackground that = (DialBackground) obj; if (!PaintUtilities.equal(this.paint, that.paint)) { return false; } if (!this.gradientPaintTransformer.equals( that.gradientPaintTransformer)) { return false; } return super.equals(obj);
if (obj == this) { return true; } if (!(obj instanceof DialPointer.Pin)) { return false; } DialPointer.Pin that = (DialPointer.Pin) obj; if (!PaintUtilities.equal(this.paint, that.paint)) { return false; } if (!this.stroke.equals(that.stroke)) { return false; } return super.equals(obj);
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/dial/DialBackground.java File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/dial/DialPointer.java
Method name: boolean equals(Object) Method name: boolean equals(Object)
Number of AST nodes: 10 Number of AST nodes: 10
1
if (obj == this) {
1
if (obj == this) {
2
            return true;
2
                return true;
3
        }
3
        
4
    }
4
        if (!(obj instanceof DialBackground)) {
5
            if (!(obj instanceof DialPointer.Pin)) {
5
            return false;
6
                return false;
6
        }
7
            }
7
        DialBackground that = (DialBackground) obj;
8
            DialPointer.Pin that = (DialPointer.Pin) obj;
8
        if (!PaintUtilities.equal(this.paint, that.paint)) {
9
            if (!PaintUtilities.equal(this.paint, that.paint)) {
9
            return false;
10
                return false;
10
        }
11
        
12
    }
11
        if (!this.gradientPaintTransformer.equals(
13
            if (!this.
12
                that.gradientPaintTransformer)) {
14
stroke.equals(that.stroke)) {
13
            return false;
15
                return false;
14
        }
16
        
17
    }
15
        return super.equals(obj);
18
            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)1.6
Clones locationClones are in different classes having the same super class
Number of node comparisons41
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements10
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)3.8
    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 DialBackground))
    3
    if (!(obj instanceof DialBackground))
    3
    if (!(obj instanceof DialPointer.Pin))
    Differences
    Expression1Expression2Difference
    org.jfree.chart.plot.dial.DialBackgroundorg.jfree.chart.plot.dial.DialPointer.PinSUBCLASS_TYPE_MISMATCH
    DialBackgroundDialPointer.PinTYPE_COMPATIBLE_REPLACEMENT
    3
    if (!(obj instanceof DialPointer.Pin))
    4
    return false;
    4
    return false;
    5
    DialBackground that = (DialBackground)obj;
    5
    DialBackground that = (DialBackground)obj;
    5
    DialPointer.Pin that = (DialPointer.Pin)obj;
    Differences
    Expression1Expression2Difference
    org.jfree.chart.plot.dial.DialBackgroundorg.jfree.chart.plot.dial.DialPointer.PinSUBCLASS_TYPE_MISMATCH
    DialBackgroundDialPointer.PinTYPE_COMPATIBLE_REPLACEMENT
    org.jfree.chart.plot.dial.DialBackgroundorg.jfree.chart.plot.dial.DialPointer.PinSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.plot.dial.DialBackgroundorg.jfree.chart.plot.dial.DialPointer.PinSUBCLASS_TYPE_MISMATCH
    DialBackgroundDialPointer.PinTYPE_COMPATIBLE_REPLACEMENT
    5
    DialPointer.Pin that = (DialPointer.Pin)obj;
    6
    if (!PaintUtilities.equal(this.paint, that.paint))
    6
    if (!PaintUtilities.equal(this.paint, that.paint))
    6
    if (!PaintUtilities.equal(this.paint, that.paint))
    Differences
    Expression1Expression2Difference
    org.jfree.chart.plot.dial.DialBackgroundorg.jfree.chart.plot.dial.DialPointer.PinSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression that.paint cannot be unified with expression that.paint , because common superclass org.jfree.chart.plot.dial.AbstractDialLayer does not declare member(s) private transient java.awt.Paint paint
    6
    if (!PaintUtilities.equal(this.paint, that.paint))
    7
    return false;
    7
    return false;
    8
    if (!this.gradientPaintTransformer.equals(that.gradientPaintTransformer))
    8
    if (!this.gradientPaintTransformer.equals(that.gradientPaintTransformer))
    8
    if (!this.stroke.equals(that.stroke))
    Differences
    Expression1Expression2Difference
    org.jfree.chart.plot.dial.DialBackgroundorg.jfree.chart.plot.dial.DialPointer.PinSUBCLASS_TYPE_MISMATCH
    gradientPaintTransformerstrokeVARIABLE_NAME_MISMATCH
    org.jfree.ui.GradientPaintTransformerjava.awt.StrokeVARIABLE_TYPE_MISMATCH
    gradientPaintTransformerstrokeVARIABLE_NAME_MISMATCH
    org.jfree.ui.GradientPaintTransformerjava.awt.StrokeVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Expression that.gradientPaintTransformer cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.stroke cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type org.jfree.ui.GradientPaintTransformer of variable that.gradientPaintTransformer does not match with type java.awt.Stroke of variable that.stroke
    • Make classes org.jfree.ui.GradientPaintTransformer and java.awt.Stroke extend a common superclass
    Type org.jfree.ui.GradientPaintTransformer of variable this.gradientPaintTransformer does not match with type java.awt.Stroke of variable this.stroke
    • Make classes org.jfree.ui.GradientPaintTransformer and java.awt.Stroke extend a common superclass
    8
    if (!this.stroke.equals(that.stroke))
    9
    return false;
    9
    return false;
    10
    return super.equals(obj);
    10
    return super.equals(obj);
    10
    return super.equals(obj);
    Preondition Violations
    Super method call return super.equals(obj); cannot be extracted from method
    Super method call return super.equals(obj); cannot be extracted from method
    10
    return super.equals(obj);
    Precondition Violations (7)
    Row Violation
    1Expression that.paint cannot be unified with expression that.paint , because common superclass org.jfree.chart.plot.dial.AbstractDialLayer does not declare member(s) private transient java.awt.Paint paint
    2Expression that.gradientPaintTransformer cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression that.stroke cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Type org.jfree.ui.GradientPaintTransformer of variable that.gradientPaintTransformer does not match with type java.awt.Stroke of variable that.stroke
    5Type org.jfree.ui.GradientPaintTransformer of variable this.gradientPaintTransformer does not match with type java.awt.Stroke of variable this.stroke
    6Super method call return super.equals(obj); cannot be extracted from method
    7Super method call return super.equals(obj); cannot be extracted from method