if (obj == this) { return true; } if (!(obj instanceof FlowArrangement)) { return false; } FlowArrangement that = (FlowArrangement) obj; if (this.horizontalAlignment != that.horizontalAlignment) { return false; } if (this.verticalAlignment != that.verticalAlignment) { return false; } if (this.horizontalGap != that.horizontalGap) { return false; } if (this.verticalGap != that.verticalGap) { 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/chart/block/FlowArrangement.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 == this) {
1
if (obj == this) {
2
            return true;   
2
            return true;
3
        }
3
        }
4
        if (!(obj instanceof FlowArrangement)) {
4
        if (!(obj instanceof OHLC)) {
5
            return false;   
5
            return false;
6
        }
6
        }
7
        FlowArrangement that = (FlowArrangement) obj;
7
        OHLC that = (OHLC) obj;
8
        if (this.horizontalAlignment != that.horizontalAlignment) {
8
        if (this.open != that.open) {
9
            return false;
9
            return false;
10
        }
10
        }
11
        if (this.verticalAlignment != that.verticalAlignment) {
11
        if (this.close != that.close) {
12
            return false;
12
            return false;
13
        }
13
        }
14
        if (this.horizontalGap != that.horizontalGap) {
14
        if (this.high != that.high) {
15
            return false;   
15
            return false;
16
        }
16
        }
17
        if (this.verticalGap != that.verticalGap) {
17
        if (this.low != that.low) {
18
            return false;   
18
            return false;
19
        }
19
        }
20
        return true;
20
        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.7
Clones locationClones are in different classes
Number of node comparisons76
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements13
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)3.3
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (obj == this)
    1
    if (obj == this)
    2
    return true;
    2
    return true;
    3
    if (!(obj instanceof FlowArrangement))
    3
    if (!(obj instanceof FlowArrangement))
    3
    if (!(obj instanceof OHLC))
    Differences
    Expression1Expression2Difference
    org.jfree.chart.block.FlowArrangementorg.jfree.data.time.ohlc.OHLCVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jfree.chart.block.FlowArrangement does not match with type org.jfree.data.time.ohlc.OHLC
    • Make classes org.jfree.chart.block.FlowArrangement and org.jfree.data.time.ohlc.OHLC extend a common superclass
    3
    if (!(obj instanceof OHLC))
    4
    return false;
    4
    return false;
                                                  
    5
    OHLC that = (OHLC)obj;
    5
    FlowArrangement that = (FlowArrangement)obj;
                                                                                              
    6
    if (this.horizontalAlignment != that.horizontalAlignment)
    6
    if (this.horizontalAlignment != that.horizontalAlignment)
    6
    if (this.open != that.open)
    Differences
    Expression1Expression2Difference
    horizontalAlignmentopenVARIABLE_NAME_MISMATCH
    org.jfree.ui.HorizontalAlignmentdoubleVARIABLE_TYPE_MISMATCH
    org.jfree.chart.block.FlowArrangementorg.jfree.data.time.ohlc.OHLCVARIABLE_TYPE_MISMATCH
    horizontalAlignmentopenVARIABLE_NAME_MISMATCH
    org.jfree.ui.HorizontalAlignmentdoubleVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jfree.ui.HorizontalAlignment of variable this.horizontalAlignment does not match with type double of variable this.open
    Type org.jfree.ui.HorizontalAlignment of variable that.horizontalAlignment does not match with type double of variable that.open
    • Make classes org.jfree.chart.block.FlowArrangement and org.jfree.data.time.ohlc.OHLC extend a common superclass
    Expression that.horizontalAlignment 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
    Type org.jfree.ui.HorizontalAlignment of variable that.horizontalAlignment does not match with type double of variable that.open
    6
    if (this.open != that.open)
    7
    return false;
    7
    return false;
    8
    if (this.verticalAlignment != that.verticalAlignment)
    8
    if (this.verticalAlignment != that.verticalAlignment)
    8
    if (this.close != that.close)
    Differences
    Expression1Expression2Difference
    verticalAlignmentcloseVARIABLE_NAME_MISMATCH
    org.jfree.ui.VerticalAlignmentdoubleVARIABLE_TYPE_MISMATCH
    org.jfree.chart.block.FlowArrangementorg.jfree.data.time.ohlc.OHLCVARIABLE_TYPE_MISMATCH
    verticalAlignmentcloseVARIABLE_NAME_MISMATCH
    org.jfree.ui.VerticalAlignmentdoubleVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jfree.ui.VerticalAlignment of variable this.verticalAlignment does not match with type double of variable this.close
    Type org.jfree.ui.VerticalAlignment of variable that.verticalAlignment does not match with type double of variable that.close
    • Make classes org.jfree.chart.block.FlowArrangement and org.jfree.data.time.ohlc.OHLC extend a common superclass
    Expression that.verticalAlignment 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
    Type org.jfree.ui.VerticalAlignment of variable that.verticalAlignment does not match with type double of variable that.close
    8
    if (this.close != that.close)
    9
    return false;
    9
    return false;
    10
    if (this.horizontalGap != that.horizontalGap)
    10
    if (this.horizontalGap != that.horizontalGap)
    10
    if (this.high != that.high)
    Differences
    Expression1Expression2Difference
    horizontalGaphighVARIABLE_NAME_MISMATCH
    org.jfree.chart.block.FlowArrangementorg.jfree.data.time.ohlc.OHLCVARIABLE_TYPE_MISMATCH
    horizontalGaphighVARIABLE_NAME_MISMATCH
    Preondition Violations
    Type double of variable that.horizontalGap does not match with type double of variable that.high
    • Make classes org.jfree.chart.block.FlowArrangement and org.jfree.data.time.ohlc.OHLC extend a common superclass
    Expression that.horizontalGap 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
    10
    if (this.high != that.high)
    11
    return false;
    11
    return false;
    12
    if (this.verticalGap != that.verticalGap)
    12
    if (this.verticalGap != that.verticalGap)
    12
    if (this.low != that.low)
    Differences
    Expression1Expression2Difference
    verticalGaplowVARIABLE_NAME_MISMATCH
    org.jfree.chart.block.FlowArrangementorg.jfree.data.time.ohlc.OHLCVARIABLE_TYPE_MISMATCH
    verticalGaplowVARIABLE_NAME_MISMATCH
    Preondition Violations
    Type double of variable that.verticalGap does not match with type double of variable that.low
    • Make classes org.jfree.chart.block.FlowArrangement and org.jfree.data.time.ohlc.OHLC extend a common superclass
    Expression that.verticalGap 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
    12
    if (this.low != that.low)
    13
    return false;
    13
    return false;
    14
    return true;
    14
    return true;
    Precondition Violations (17)
    Row Violation
    1Type org.jfree.chart.block.FlowArrangement does not match with type org.jfree.data.time.ohlc.OHLC
    2Type org.jfree.ui.HorizontalAlignment of variable this.horizontalAlignment does not match with type double of variable this.open
    3Type org.jfree.ui.HorizontalAlignment of variable that.horizontalAlignment does not match with type double of variable that.open
    4Expression that.horizontalAlignment cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression that.open cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Type org.jfree.ui.HorizontalAlignment of variable that.horizontalAlignment does not match with type double of variable that.open
    7Type org.jfree.ui.VerticalAlignment of variable this.verticalAlignment does not match with type double of variable this.close
    8Type org.jfree.ui.VerticalAlignment of variable that.verticalAlignment does not match with type double of variable that.close
    9Expression that.verticalAlignment cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10Expression that.close cannot be parameterized, because it has dependencies to/from statements that will be extracted
    11Type org.jfree.ui.VerticalAlignment of variable that.verticalAlignment does not match with type double of variable that.close
    12Type double of variable that.horizontalGap does not match with type double of variable that.high
    13Expression that.horizontalGap cannot be parameterized, because it has dependencies to/from statements that will be extracted
    14Expression that.high cannot be parameterized, because it has dependencies to/from statements that will be extracted
    15Type double of variable that.verticalGap does not match with type double of variable that.low
    16Expression that.verticalGap cannot be parameterized, because it has dependencies to/from statements that will be extracted
    17Expression that.low cannot be parameterized, because it has dependencies to/from statements that will be extracted