if (obj == this) { return true; } if (!(obj instanceof XYSplineRenderer)) { return false; } XYSplineRenderer that = (XYSplineRenderer) obj; if (this.precision != that.precision) { 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/XYSplineRenderer.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
    }
4
        if (!(obj instanceof XYSplineRenderer)) {
5
            if (!(obj instanceof ControlPoint)) {
5
            return false;
6
                return false;
6
        }
7
            }
7
        XYSplineRenderer that = (XYSplineRenderer) obj;
8
            ControlPoint that = (ControlPoint) obj;
8
        if (this.precision != that.precision) {
9
            if (this.x != that.x) {
9
            return false;
10
                return false;
10
        }
11
            }
11
        return super.equals(obj)
12
            /*&& y == ((ControlPoint) obj).y*/;
12
;
13
            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 the same java file
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)1.7
    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 XYSplineRenderer))
    3
    if (!(obj instanceof XYSplineRenderer))
    3
    if (!(obj instanceof ControlPoint))
    Differences
    Expression1Expression2Difference
    org.jfree.chart.renderer.xy.XYSplineRendererorg.jfree.chart.renderer.xy.XYSplineRenderer.ControlPointVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jfree.chart.renderer.xy.XYSplineRenderer does not match with type org.jfree.chart.renderer.xy.XYSplineRenderer.ControlPoint
    • Make classes org.jfree.chart.renderer.xy.XYSplineRenderer 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
    XYSplineRenderer that = (XYSplineRenderer)obj;
                                                                                                  
    6
    if (this.precision != that.precision)
    6
    if (this.precision != that.precision)
    6
    if (this.x != that.x)
    Differences
    Expression1Expression2Difference
    precisionxVARIABLE_NAME_MISMATCH
    intfloatVARIABLE_TYPE_MISMATCH
    org.jfree.chart.renderer.xy.XYSplineRendererorg.jfree.chart.renderer.xy.XYSplineRenderer.ControlPointVARIABLE_TYPE_MISMATCH
    precisionxVARIABLE_NAME_MISMATCH
    intfloatVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type int of variable this.precision does not match with type float of variable this.x
    Type int of variable that.precision does not match with type float of variable that.x
    • Make classes org.jfree.chart.renderer.xy.XYSplineRenderer and org.jfree.chart.renderer.xy.XYSplineRenderer.ControlPoint extend a common superclass
    Expression that.precision 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.precision 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.XYSplineRenderer does not match with type org.jfree.chart.renderer.xy.XYSplineRenderer.ControlPoint
    2Type int of variable this.precision does not match with type float of variable this.x
    3Type int of variable that.precision does not match with type float of variable that.x
    4Expression that.precision 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.precision 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.XYSplineRenderer and org.jfree.chart.renderer.xy.XYSplineRenderer.ControlPoint do not have a common superclass