if (obj == this) { return true; } if (!(obj instanceof DeviationRenderer)) { return false; } DeviationRenderer that = (DeviationRenderer) obj; if (this.alpha != that.alpha) { 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/DeviationRenderer.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 DeviationRenderer)) {
5
            if (!(obj instanceof ControlPoint)) {
5
            return false;
6
                return false;
6
        }
7
            }
7
        DeviationRenderer that = (DeviationRenderer) obj;
8
            ControlPoint that = (ControlPoint) obj;
8
        if (this.alpha != that.alpha) {
9
            if (this.x != that.x) {
9
            return false;
10
                return false;
10
        }
11
        
11
        return super.equals(obj)
12
    }
13
            /*&& y == ((ControlPoint) obj).y*/;
12
;
14
            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)1.8
    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 DeviationRenderer))
    3
    if (!(obj instanceof DeviationRenderer))
    3
    if (!(obj instanceof ControlPoint))
    Differences
    Expression1Expression2Difference
    org.jfree.chart.renderer.xy.DeviationRendererorg.jfree.chart.renderer.xy.XYSplineRenderer.ControlPointVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jfree.chart.renderer.xy.DeviationRenderer does not match with type org.jfree.chart.renderer.xy.XYSplineRenderer.ControlPoint
    • Make classes org.jfree.chart.renderer.xy.DeviationRenderer 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
    DeviationRenderer that = (DeviationRenderer)obj;
                                                                                                      
    6
    if (this.alpha != that.alpha)
    6
    if (this.alpha != that.alpha)
    6
    if (this.x != that.x)
    Differences
    Expression1Expression2Difference
    alphaxVARIABLE_NAME_MISMATCH
    org.jfree.chart.renderer.xy.DeviationRendererorg.jfree.chart.renderer.xy.XYSplineRenderer.ControlPointVARIABLE_TYPE_MISMATCH
    alphaxVARIABLE_NAME_MISMATCH
    Preondition Violations
    Type float of variable that.alpha does not match with type float of variable that.x
    • Make classes org.jfree.chart.renderer.xy.DeviationRenderer and org.jfree.chart.renderer.xy.XYSplineRenderer.ControlPoint extend a common superclass
    Expression that.alpha 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
    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 (6)
    Row Violation
    1Type org.jfree.chart.renderer.xy.DeviationRenderer does not match with type org.jfree.chart.renderer.xy.XYSplineRenderer.ControlPoint
    2Type float of variable that.alpha does not match with type float of variable that.x
    3Expression that.alpha cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression that.x cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Super method call return super.equals(obj); cannot be extracted from method
    6The refactoring of the clones is infeasible, because classes org.jfree.chart.renderer.xy.DeviationRenderer and org.jfree.chart.renderer.xy.XYSplineRenderer.ControlPoint do not have a common superclass