if (obj == this) { return true; } if (obj instanceof ContourEntity && super.equals(obj)) { ContourEntity ce = (ContourEntity) obj; if (this.index != ce.index) { return false; } return true; } return false;
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);
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/entity/ContourEntity.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: 8
1
if (obj == this) {
1
if (obj == this) {
2
            return true;   
2
            return true;
3
        }
3
        }
4
        if (obj instanceof ContourEntity && super.equals(obj)) {
4
        if (!(obj instanceof XYSplineRenderer)) {
5
            ContourEntity ce = (ContourEntity
5
            return false;
6
        }
6
) obj;
7
        XYSplineRenderer that = (XYSplineRenderer) obj;
7
            if (this.index != ce.index) {
8
        if (this.precision != that.precision) {
8
                return false;   
9
            return false;
9
            }
10
        
10
    
11
}
11
        return true;
12
        return 
12
        }
13
        return false;
13
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)0.4
Clones locationClones are in different classes
Number of node comparisons7
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements3
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)1.9
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    4
    ContourEntity ce = (ContourEntity)obj;
    4
    ContourEntity ce = (ContourEntity)obj;
    5
    XYSplineRenderer that = (XYSplineRenderer)obj;
    Differences
    Expression1Expression2Difference
    org.jfree.chart.entity.ContourEntityorg.jfree.chart.renderer.xy.XYSplineRendererSUBCLASS_TYPE_MISMATCH
    cethatVARIABLE_NAME_MISMATCH
    org.jfree.chart.entity.ContourEntityorg.jfree.chart.renderer.xy.XYSplineRendererSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.entity.ContourEntityorg.jfree.chart.renderer.xy.XYSplineRendererSUBCLASS_TYPE_MISMATCH
    5
    XYSplineRenderer that = (XYSplineRenderer)obj;
    5
    if (this.index != ce.index)
    5
    if (this.index != ce.index)
    6
    if (this.precision != that.precision)
    Differences
    Expression1Expression2Difference
    indexprecisionVARIABLE_NAME_MISMATCH
    cethatVARIABLE_NAME_MISMATCH
    org.jfree.chart.entity.ContourEntityorg.jfree.chart.renderer.xy.XYSplineRendererSUBCLASS_TYPE_MISMATCH
    indexprecisionVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression ce.index cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.precision cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression ce.index cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.precision cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6
    if (this.precision != that.precision)
    6
    return false;
    7
    return false;
    Precondition Violations (5)
    Row Violation
    1Expression ce.index cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression that.precision cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression ce.index cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression that.precision cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Not all possible execution flows end in a return statement