if (obj == this) { return true; } if (!(obj instanceof ColumnArrangement)) { return false; } ColumnArrangement that = (ColumnArrangement) 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 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;
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/block/ColumnArrangement.java File path: /jfreechart-1.0.10/src/org/jfree/data/statistics/SimpleHistogramBin.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 instanceof SimpleHistogramBin)) {
2
            return true;   
2
            return false;
3
        }
3
        }
4
        if (!(obj instanceof ColumnArrangement)
4
        SimpleHistogramBin that = (SimpleHistogramBin) obj;
5
) {
5
        if (this.lowerBound != that.lowerBound) {
6
            return false;   
6
            return false;
7
        }
7
        }
8
        ColumnArrangement that = (ColumnArrangement) obj;
8
        
9
        if (this.horizontalAlignment != that.horizontalAlignment) {
9
if (this.upperBound != that.upperBound) {
10
            return false;
10
            return false;
11
        }
11
        }
12
        if (this.verticalAlignment != that.verticalAlignment) {
12
        if (this.includeLowerBound != that.includeLowerBound) {
13
            return false;
13
            return false;
14
        }
14
        }
15
        if (this.horizontalGap != that.horizontalGap) {
15
        if (this.includeUpperBound != that.includeUpperBound) {
16
            return false;   
16
            return false;
17
        }
17
        }
18
        if (this.verticalGap != that.verticalGap) {
18
        if (this.itemCount != that.itemCount) {
19
            return false;   
19
            return false;
20
        }
20
        }
21
        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)3.1
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)3.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    3
    if (!(obj instanceof ColumnArrangement))
    3
    if (!(obj instanceof ColumnArrangement))
    1
    if (!(obj instanceof SimpleHistogramBin))
    Differences
    Expression1Expression2Difference
    org.jfree.chart.block.ColumnArrangementorg.jfree.data.statistics.SimpleHistogramBinVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jfree.chart.block.ColumnArrangement does not match with type org.jfree.data.statistics.SimpleHistogramBin
    • Make classes org.jfree.chart.block.ColumnArrangement and org.jfree.data.statistics.SimpleHistogramBin extend a common superclass
    1
    if (!(obj instanceof SimpleHistogramBin))
    4
    return false;
    2
    return false;
                                                                                                          
    3
    SimpleHistogramBin that = (SimpleHistogramBin)obj;
    5
    ColumnArrangement that = (ColumnArrangement)obj;
                                                                                                      
    6
    if (this.horizontalAlignment != that.horizontalAlignment)
    6
    if (this.horizontalAlignment != that.horizontalAlignment)
    4
    if (this.lowerBound != that.lowerBound)
    Differences
    Expression1Expression2Difference
    horizontalAlignmentlowerBoundVARIABLE_NAME_MISMATCH
    org.jfree.ui.HorizontalAlignmentdoubleVARIABLE_TYPE_MISMATCH
    org.jfree.chart.block.ColumnArrangementorg.jfree.data.statistics.SimpleHistogramBinVARIABLE_TYPE_MISMATCH
    horizontalAlignmentlowerBoundVARIABLE_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.lowerBound
    Type org.jfree.ui.HorizontalAlignment of variable that.horizontalAlignment does not match with type double of variable that.lowerBound
    • Make classes org.jfree.chart.block.ColumnArrangement and org.jfree.data.statistics.SimpleHistogramBin extend a common superclass
    Expression that.horizontalAlignment cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.lowerBound 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.lowerBound
    4
    if (this.lowerBound != that.lowerBound)
    7
    return false;
    5
    return false;
    8
    if (this.verticalAlignment != that.verticalAlignment)
    8
    if (this.verticalAlignment != that.verticalAlignment)
    6
    if (this.upperBound != that.upperBound)
    Differences
    Expression1Expression2Difference
    verticalAlignmentupperBoundVARIABLE_NAME_MISMATCH
    org.jfree.ui.VerticalAlignmentdoubleVARIABLE_TYPE_MISMATCH
    org.jfree.chart.block.ColumnArrangementorg.jfree.data.statistics.SimpleHistogramBinVARIABLE_TYPE_MISMATCH
    verticalAlignmentupperBoundVARIABLE_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.upperBound
    Type org.jfree.ui.VerticalAlignment of variable that.verticalAlignment does not match with type double of variable that.upperBound
    • Make classes org.jfree.chart.block.ColumnArrangement and org.jfree.data.statistics.SimpleHistogramBin extend a common superclass
    Expression that.verticalAlignment cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.upperBound 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.upperBound
    6
    if (this.upperBound != that.upperBound)
    9
    return false;
    7
    return false;
    10
    if (this.horizontalGap != that.horizontalGap)
    10
    if (this.horizontalGap != that.horizontalGap)
    8
    if (this.includeLowerBound != that.includeLowerBound)
    Differences
    Expression1Expression2Difference
    horizontalGapincludeLowerBoundVARIABLE_NAME_MISMATCH
    doublebooleanVARIABLE_TYPE_MISMATCH
    org.jfree.chart.block.ColumnArrangementorg.jfree.data.statistics.SimpleHistogramBinVARIABLE_TYPE_MISMATCH
    horizontalGapincludeLowerBoundVARIABLE_NAME_MISMATCH
    doublebooleanVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type double of variable this.horizontalGap does not match with type boolean of variable this.includeLowerBound
    Type double of variable that.horizontalGap does not match with type boolean of variable that.includeLowerBound
    • Make classes org.jfree.chart.block.ColumnArrangement and org.jfree.data.statistics.SimpleHistogramBin extend a common superclass
    Expression that.horizontalGap cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.includeLowerBound cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type double of variable that.horizontalGap does not match with type boolean of variable that.includeLowerBound
    8
    if (this.includeLowerBound != that.includeLowerBound)
    11
    return false;
    9
    return false;
    12
    if (this.verticalGap != that.verticalGap)
    12
    if (this.verticalGap != that.verticalGap)
    10
    if (this.includeUpperBound != that.includeUpperBound)
    Differences
    Expression1Expression2Difference
    verticalGapincludeUpperBoundVARIABLE_NAME_MISMATCH
    doublebooleanVARIABLE_TYPE_MISMATCH
    org.jfree.chart.block.ColumnArrangementorg.jfree.data.statistics.SimpleHistogramBinVARIABLE_TYPE_MISMATCH
    verticalGapincludeUpperBoundVARIABLE_NAME_MISMATCH
    doublebooleanVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type double of variable this.verticalGap does not match with type boolean of variable this.includeUpperBound
    Type double of variable that.verticalGap does not match with type boolean of variable that.includeUpperBound
    • Make classes org.jfree.chart.block.ColumnArrangement and org.jfree.data.statistics.SimpleHistogramBin extend a common superclass
    Expression that.verticalGap cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.includeUpperBound cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type double of variable that.verticalGap does not match with type boolean of variable that.includeUpperBound
    10
    if (this.includeUpperBound != that.includeUpperBound)
    13
    return false;
    11
    return false;
    Precondition Violations (22)
    Row Violation
    1Type org.jfree.chart.block.ColumnArrangement does not match with type org.jfree.data.statistics.SimpleHistogramBin
    2Type org.jfree.ui.HorizontalAlignment of variable this.horizontalAlignment does not match with type double of variable this.lowerBound
    3Type org.jfree.ui.HorizontalAlignment of variable that.horizontalAlignment does not match with type double of variable that.lowerBound
    4Expression that.horizontalAlignment cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression that.lowerBound 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.lowerBound
    7Type org.jfree.ui.VerticalAlignment of variable this.verticalAlignment does not match with type double of variable this.upperBound
    8Type org.jfree.ui.VerticalAlignment of variable that.verticalAlignment does not match with type double of variable that.upperBound
    9Expression that.verticalAlignment cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10Expression that.upperBound 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.upperBound
    12Type double of variable this.horizontalGap does not match with type boolean of variable this.includeLowerBound
    13Type double of variable that.horizontalGap does not match with type boolean of variable that.includeLowerBound
    14Expression that.horizontalGap cannot be parameterized, because it has dependencies to/from statements that will be extracted
    15Expression that.includeLowerBound cannot be parameterized, because it has dependencies to/from statements that will be extracted
    16Type double of variable that.horizontalGap does not match with type boolean of variable that.includeLowerBound
    17Type double of variable this.verticalGap does not match with type boolean of variable this.includeUpperBound
    18Type double of variable that.verticalGap does not match with type boolean of variable that.includeUpperBound
    19Expression that.verticalGap cannot be parameterized, because it has dependencies to/from statements that will be extracted
    20Expression that.includeUpperBound cannot be parameterized, because it has dependencies to/from statements that will be extracted
    21Type double of variable that.verticalGap does not match with type boolean of variable that.includeUpperBound
    22Not all possible execution flows end in a return statement