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