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