if (obj == this) { return true; } if (!(obj instanceof XYBubbleRenderer)) { return false; } XYBubbleRenderer that = (XYBubbleRenderer) obj; if (this.scaleType != that.scaleType) { return false; } return super.equals(obj);
if (obj == this) { return true; } if (!(obj instanceof ControlPoint)) { return false; } ControlPoint that = (ControlPoint) obj; if (this.x != that.x) { return false; } /*&& y == ((ControlPoint) obj).y*/; return true;
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/xy/XYBubbleRenderer.java File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/xy/XYSplineRenderer.java
Method name: boolean equals(Object) Method name: boolean equals(Object)
Number of AST nodes: 8 Number of AST nodes: 9
1
if (obj == this) {
1
if (obj == this) {
2
            return true;
2
                return true;
3
        }
3
            }
4
        if (!(obj instanceof XYBubbleRenderer)) {
4
            if (!(obj instanceof ControlPoint)) {
5
            return false;
5
                return false;
6
        }
6
            }
7
        XYBubbleRenderer that = (XYBubbleRenderer) obj;
7
            ControlPoint that = (ControlPoint) obj;
8
        if (this.scaleType != that.scaleType) {
8
            if (this.x != that.x) {
9
            return false;
9
                return false;
10
        }
10
            }
11
        return super.equals(obj)
11
            /*&& y == ((ControlPoint) obj).y*/;
12
;
12
            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)0.7
Clones locationClones are in different classes
Number of node comparisons24
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements7
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)2.1
    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 XYBubbleRenderer))
    3
    if (!(obj instanceof XYBubbleRenderer))
    3
    if (!(obj instanceof ControlPoint))
    Differences
    Expression1Expression2Difference
    org.jfree.chart.renderer.xy.XYBubbleRendererorg.jfree.chart.renderer.xy.XYSplineRenderer.ControlPointVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jfree.chart.renderer.xy.XYBubbleRenderer does not match with type org.jfree.chart.renderer.xy.XYSplineRenderer.ControlPoint
    • Make classes org.jfree.chart.renderer.xy.XYBubbleRenderer and org.jfree.chart.renderer.xy.XYSplineRenderer.ControlPoint extend a common superclass
    3
    if (!(obj instanceof ControlPoint))
    4
    return false;
    4
    return false;
                                                                                  
    5
    ControlPoint that = (ControlPoint)obj;
    5
    XYBubbleRenderer that = (XYBubbleRenderer)obj;
                                                                                                  
    6
    if (this.scaleType != that.scaleType)
    6
    if (this.scaleType != that.scaleType)
    6
    if (this.x != that.x)
    Differences
    Expression1Expression2Difference
    scaleTypexVARIABLE_NAME_MISMATCH
    intfloatVARIABLE_TYPE_MISMATCH
    org.jfree.chart.renderer.xy.XYBubbleRendererorg.jfree.chart.renderer.xy.XYSplineRenderer.ControlPointVARIABLE_TYPE_MISMATCH
    scaleTypexVARIABLE_NAME_MISMATCH
    intfloatVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type int of variable this.scaleType does not match with type float of variable this.x
    Type int of variable that.scaleType does not match with type float of variable that.x
    • Make classes org.jfree.chart.renderer.xy.XYBubbleRenderer and org.jfree.chart.renderer.xy.XYSplineRenderer.ControlPoint extend a common superclass
    Expression that.scaleType cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.x cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type int of variable that.scaleType does not match with type float of variable that.x
    6
    if (this.x != that.x)
    7
    return false;
    7
    return false;
            
    8
    ;
    8
    return super.equals(obj);
    8
    return super.equals(obj);
    9
    return true;
    Differences
    Expression1Expression2Difference
    super.equals(obj)trueTYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Super method call return super.equals(obj); cannot be extracted from method
    9
    return true;
    Precondition Violations (8)
    Row Violation
    1Type org.jfree.chart.renderer.xy.XYBubbleRenderer does not match with type org.jfree.chart.renderer.xy.XYSplineRenderer.ControlPoint
    2Type int of variable this.scaleType does not match with type float of variable this.x
    3Type int of variable that.scaleType does not match with type float of variable that.x
    4Expression that.scaleType cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression that.x cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Type int of variable that.scaleType does not match with type float of variable that.x
    7Super method call return super.equals(obj); cannot be extracted from method
    8The refactoring of the clones is infeasible, because classes org.jfree.chart.renderer.xy.XYBubbleRenderer and org.jfree.chart.renderer.xy.XYSplineRenderer.ControlPoint do not have a common superclass