if (!(obj instanceof SimpleHistogramBin)) { return false; } SimpleHistogramBin that = (SimpleHistogramBin) obj; if (this.lowerBound != that.lowerBound) { return false; } if (this.upperBound != that.upperBound) { return false; } if (this.includeLowerBound != that.includeLowerBound) { return false; } if (this.includeUpperBound != that.includeUpperBound) { return false; } if (this.itemCount != that.itemCount) { return false; } return true;
if (obj == this) { return true; } if (!(obj instanceof OHLC)) { return false; } OHLC that = (OHLC) obj; if (this.open != that.open) { return false; } if (this.close != that.close) { return false; } if (this.high != that.high) { return false; } if (this.low != that.low) { return false; } return true;
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/data/statistics/SimpleHistogramBin.java File path: /jfreechart-1.0.10/src/org/jfree/data/time/ohlc/OHLC.java
Method name: boolean equals(Object) Method name: boolean equals(Object)
Number of AST nodes: 14 Number of AST nodes: 14
1
if (!(obj instanceof SimpleHistogramBin)) {
1
if (obj == this) {
2
            return false;
2
            return true;
3
        }
3
        }
4
        SimpleHistogramBin that = (SimpleHistogramBin) obj;
4
        
5
        if (this.lowerBound != that.lowerBound) {
5
if (!(obj instanceof OHLC)) {
6
            return false;
6
            return false;
7
        }
7
        }
8
        OHLC that = (OHLC) obj;
8
        if (this.upperBound != that.upperBound) {
9
        if (this.open != that.open) {
9
            return false;
10
            return false;
10
        }
11
        }
11
        if (this.includeLowerBound != that.includeLowerBound) {
12
        if (this.close != that.close) {
12
            return false;
13
            return false;
13
        }
14
        }
14
        if (this.includeUpperBound != that.includeUpperBound) {
15
        if (this.high != that.high) {
15
            return false;
16
            return false;
16
        }
17
        }
17
        if (this.itemCount != that.itemCount) {
18
        if (this.low != that.low) {
18
            return false;
19
            return false;
19
        }
20
        }
20
        return true;
21
        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)2.8
Clones locationClones are in different classes
Number of node comparisons70
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements10
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)2.9
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (!(obj instanceof SimpleHistogramBin))
    1
    if (!(obj instanceof SimpleHistogramBin))
    3
    if (!(obj instanceof OHLC))
    Differences
    Expression1Expression2Difference
    org.jfree.data.statistics.SimpleHistogramBinorg.jfree.data.time.ohlc.OHLCVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jfree.data.statistics.SimpleHistogramBin does not match with type org.jfree.data.time.ohlc.OHLC
    • Make classes org.jfree.data.statistics.SimpleHistogramBin and org.jfree.data.time.ohlc.OHLC extend a common superclass
    3
    if (!(obj instanceof OHLC))
    2
    return false;
    4
    return false;
    3
    SimpleHistogramBin that = (SimpleHistogramBin)obj;
                                                                                                          
                                                  
    5
    OHLC that = (OHLC)obj;
    4
    if (this.lowerBound != that.lowerBound)
    4
    if (this.lowerBound != that.lowerBound)
    6
    if (this.open != that.open)
    Differences
    Expression1Expression2Difference
    lowerBoundopenVARIABLE_NAME_MISMATCH
    org.jfree.data.statistics.SimpleHistogramBinorg.jfree.data.time.ohlc.OHLCVARIABLE_TYPE_MISMATCH
    lowerBoundopenVARIABLE_NAME_MISMATCH
    Preondition Violations
    Type double of variable that.lowerBound does not match with type double of variable that.open
    • Make classes org.jfree.data.statistics.SimpleHistogramBin and org.jfree.data.time.ohlc.OHLC extend a common superclass
    Expression that.lowerBound cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.open cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6
    if (this.open != that.open)
    5
    return false;
    7
    return false;
    6
    if (this.upperBound != that.upperBound)
    6
    if (this.upperBound != that.upperBound)
    8
    if (this.close != that.close)
    Differences
    Expression1Expression2Difference
    upperBoundcloseVARIABLE_NAME_MISMATCH
    org.jfree.data.statistics.SimpleHistogramBinorg.jfree.data.time.ohlc.OHLCVARIABLE_TYPE_MISMATCH
    upperBoundcloseVARIABLE_NAME_MISMATCH
    Preondition Violations
    Type double of variable that.upperBound does not match with type double of variable that.close
    • Make classes org.jfree.data.statistics.SimpleHistogramBin and org.jfree.data.time.ohlc.OHLC extend a common superclass
    Expression that.upperBound cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.close cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8
    if (this.close != that.close)
    7
    return false;
    9
    return false;
    8
    if (this.includeLowerBound != that.includeLowerBound)
    8
    if (this.includeLowerBound != that.includeLowerBound)
    10
    if (this.high != that.high)
    Differences
    Expression1Expression2Difference
    includeLowerBoundhighVARIABLE_NAME_MISMATCH
    booleandoubleVARIABLE_TYPE_MISMATCH
    org.jfree.data.statistics.SimpleHistogramBinorg.jfree.data.time.ohlc.OHLCVARIABLE_TYPE_MISMATCH
    includeLowerBoundhighVARIABLE_NAME_MISMATCH
    booleandoubleVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type boolean of variable this.includeLowerBound does not match with type double of variable this.high
    Type boolean of variable that.includeLowerBound does not match with type double of variable that.high
    • Make classes org.jfree.data.statistics.SimpleHistogramBin and org.jfree.data.time.ohlc.OHLC extend a common superclass
    Expression that.includeLowerBound cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.high cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type boolean of variable that.includeLowerBound does not match with type double of variable that.high
    10
    if (this.high != that.high)
    9
    return false;
    11
    return false;
    10
    if (this.includeUpperBound != that.includeUpperBound)
    10
    if (this.includeUpperBound != that.includeUpperBound)
    12
    if (this.low != that.low)
    Differences
    Expression1Expression2Difference
    includeUpperBoundlowVARIABLE_NAME_MISMATCH
    booleandoubleVARIABLE_TYPE_MISMATCH
    org.jfree.data.statistics.SimpleHistogramBinorg.jfree.data.time.ohlc.OHLCVARIABLE_TYPE_MISMATCH
    includeUpperBoundlowVARIABLE_NAME_MISMATCH
    booleandoubleVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type boolean of variable this.includeUpperBound does not match with type double of variable this.low
    Type boolean of variable that.includeUpperBound does not match with type double of variable that.low
    • Make classes org.jfree.data.statistics.SimpleHistogramBin and org.jfree.data.time.ohlc.OHLC extend a common superclass
    Expression that.includeUpperBound cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.low cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type boolean of variable that.includeUpperBound does not match with type double of variable that.low
    12
    if (this.low != that.low)
    11
    return false;
    13
    return false;
    Precondition Violations (18)
    Row Violation
    1Type org.jfree.data.statistics.SimpleHistogramBin does not match with type org.jfree.data.time.ohlc.OHLC
    2Type double of variable that.lowerBound does not match with type double of variable that.open
    3Expression that.lowerBound cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression that.open cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Type double of variable that.upperBound does not match with type double of variable that.close
    6Expression that.upperBound cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression that.close cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Type boolean of variable this.includeLowerBound does not match with type double of variable this.high
    9Type boolean of variable that.includeLowerBound does not match with type double of variable that.high
    10Expression that.includeLowerBound cannot be parameterized, because it has dependencies to/from statements that will be extracted
    11Expression that.high cannot be parameterized, because it has dependencies to/from statements that will be extracted
    12Type boolean of variable that.includeLowerBound does not match with type double of variable that.high
    13Type boolean of variable this.includeUpperBound does not match with type double of variable this.low
    14Type boolean of variable that.includeUpperBound does not match with type double of variable that.low
    15Expression that.includeUpperBound cannot be parameterized, because it has dependencies to/from statements that will be extracted
    16Expression that.low cannot be parameterized, because it has dependencies to/from statements that will be extracted
    17Type boolean of variable that.includeUpperBound does not match with type double of variable that.low
    18Not all possible execution flows end in a return statement