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 CategoryStepRenderer)) { return false; } CategoryStepRenderer that = (CategoryStepRenderer) obj; if (this.stagger != that.stagger) { 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/category/CategoryStepRenderer.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 CategoryStepRenderer)) {
5
            ContourEntity ce = (ContourEntity
5
            return false;
6
        }
6
) obj;
7
        CategoryStepRenderer that = (CategoryStepRenderer) obj;
7
            if (this.index != ce.index) {
8
        if (this.stagger != that.stagger) {
8
                return false;   
9
            return false;
9
  
10
          }
10
        }
11
            return true;
11
        return 
12
        }
13
        return false;
12
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.5
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.8
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    4
    ContourEntity ce = (ContourEntity)obj;
    4
    ContourEntity ce = (ContourEntity)obj;
    5
    CategoryStepRenderer that = (CategoryStepRenderer)obj;
    Differences
    Expression1Expression2Difference
    org.jfree.chart.entity.ContourEntityorg.jfree.chart.renderer.category.CategoryStepRendererSUBCLASS_TYPE_MISMATCH
    cethatVARIABLE_NAME_MISMATCH
    org.jfree.chart.entity.ContourEntityorg.jfree.chart.renderer.category.CategoryStepRendererSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.entity.ContourEntityorg.jfree.chart.renderer.category.CategoryStepRendererSUBCLASS_TYPE_MISMATCH
    5
    CategoryStepRenderer that = (CategoryStepRenderer)obj;
    5
    if (this.index != ce.index)
    5
    if (this.index != ce.index)
    6
    if (this.stagger != that.stagger)
    Differences
    Expression1Expression2Difference
    indexstaggerVARIABLE_NAME_MISMATCH
    intbooleanVARIABLE_TYPE_MISMATCH
    cethatVARIABLE_NAME_MISMATCH
    org.jfree.chart.entity.ContourEntityorg.jfree.chart.renderer.category.CategoryStepRendererSUBCLASS_TYPE_MISMATCH
    indexstaggerVARIABLE_NAME_MISMATCH
    intbooleanVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type int of variable this.index does not match with type boolean of variable this.stagger
    Expression ce.index cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.stagger 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.stagger cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type int of variable ce.index does not match with type boolean of variable that.stagger
    6
    if (this.stagger != that.stagger)
    6
    return false;
    7
    return false;
    Precondition Violations (7)
    Row Violation
    1Type int of variable this.index does not match with type boolean of variable this.stagger
    2Expression ce.index cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression that.stagger cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression ce.index cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression that.stagger cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Type int of variable ce.index does not match with type boolean of variable that.stagger
    7Not all possible execution flows end in a return statement