if (obj == this) { return true; } if (!(obj instanceof AxisSpace)) { return false; } AxisSpace that = (AxisSpace) obj; if (this.top != that.top) { return false; } if (this.bottom != that.bottom) { return false; } if (this.left != that.left) { return false; } if (this.right != that.right) { 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/axis/AxisSpace.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 AxisSpace)
4
        SimpleHistogramBin that = (SimpleHistogramBin) obj;
5
) {
5
        if (this.lowerBound != that.lowerBound) {
6
            return false;
6
            return false;
7
        }
7
        }
8
        AxisSpace that = (AxisSpace) obj;
8
        
9
        if (this.top != that.top) {
9
if (this.upperBound != that.upperBound) {
10
            return false;
10
            return false;
11
        }   
11
        }
12
        if (this.bottom != that.bottom) {
12
        if (this.includeLowerBound != that.includeLowerBound) {
13
            return false;
13
            return false;
14
        }
14
        }
15
        if (this.left != that.left) {
15
        if (this.includeUpperBound != that.includeUpperBound) {
16
            return false;
16
            return false;
17
        }
17
        }
18
        if (this.right != that.right) {
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.5
Clones locationClones are in different classes
Number of node comparisons70
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements11
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)3.4
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    3
    if (!(obj instanceof AxisSpace))
    3
    if (!(obj instanceof AxisSpace))
    1
    if (!(obj instanceof SimpleHistogramBin))
    Differences
    Expression1Expression2Difference
    org.jfree.chart.axis.AxisSpaceorg.jfree.data.statistics.SimpleHistogramBinSUBCLASS_TYPE_MISMATCH
    1
    if (!(obj instanceof SimpleHistogramBin))
    4
    return false;
    2
    return false;
    5
    AxisSpace that = (AxisSpace)obj;
    5
    AxisSpace that = (AxisSpace)obj;
    3
    SimpleHistogramBin that = (SimpleHistogramBin)obj;
    Differences
    Expression1Expression2Difference
    org.jfree.chart.axis.AxisSpaceorg.jfree.data.statistics.SimpleHistogramBinSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.axis.AxisSpaceorg.jfree.data.statistics.SimpleHistogramBinSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.axis.AxisSpaceorg.jfree.data.statistics.SimpleHistogramBinSUBCLASS_TYPE_MISMATCH
    3
    SimpleHistogramBin that = (SimpleHistogramBin)obj;
    6
    if (this.top != that.top)
    6
    if (this.top != that.top)
    4
    if (this.lowerBound != that.lowerBound)
    Differences
    Expression1Expression2Difference
    toplowerBoundVARIABLE_NAME_MISMATCH
    org.jfree.chart.axis.AxisSpaceorg.jfree.data.statistics.SimpleHistogramBinSUBCLASS_TYPE_MISMATCH
    toplowerBoundVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression that.top 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
    4
    if (this.lowerBound != that.lowerBound)
    7
    return false;
    5
    return false;
    8
    if (this.bottom != that.bottom)
    8
    if (this.bottom != that.bottom)
    6
    if (this.upperBound != that.upperBound)
    Differences
    Expression1Expression2Difference
    bottomupperBoundVARIABLE_NAME_MISMATCH
    org.jfree.chart.axis.AxisSpaceorg.jfree.data.statistics.SimpleHistogramBinSUBCLASS_TYPE_MISMATCH
    bottomupperBoundVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression that.bottom 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
    6
    if (this.upperBound != that.upperBound)
    9
    return false;
    7
    return false;
    10
    if (this.left != that.left)
    10
    if (this.left != that.left)
    8
    if (this.includeLowerBound != that.includeLowerBound)
    Differences
    Expression1Expression2Difference
    leftincludeLowerBoundVARIABLE_NAME_MISMATCH
    doublebooleanVARIABLE_TYPE_MISMATCH
    org.jfree.chart.axis.AxisSpaceorg.jfree.data.statistics.SimpleHistogramBinSUBCLASS_TYPE_MISMATCH
    leftincludeLowerBoundVARIABLE_NAME_MISMATCH
    doublebooleanVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type double of variable this.left does not match with type boolean of variable this.includeLowerBound
    Expression that.left 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.left 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.right != that.right)
    12
    if (this.right != that.right)
    10
    if (this.includeUpperBound != that.includeUpperBound)
    Differences
    Expression1Expression2Difference
    rightincludeUpperBoundVARIABLE_NAME_MISMATCH
    doublebooleanVARIABLE_TYPE_MISMATCH
    org.jfree.chart.axis.AxisSpaceorg.jfree.data.statistics.SimpleHistogramBinSUBCLASS_TYPE_MISMATCH
    rightincludeUpperBoundVARIABLE_NAME_MISMATCH
    doublebooleanVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type double of variable this.right does not match with type boolean of variable this.includeUpperBound
    Expression that.right 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.right does not match with type boolean of variable that.includeUpperBound
    10
    if (this.includeUpperBound != that.includeUpperBound)
    13
    return false;
    11
    return false;
    Precondition Violations (14)
    Row Violation
    1Expression that.top cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression that.lowerBound cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression that.bottom cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression that.upperBound cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Type double of variable this.left does not match with type boolean of variable this.includeLowerBound
    6Expression that.left cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression that.includeLowerBound cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Type double of variable that.left does not match with type boolean of variable that.includeLowerBound
    9Type double of variable this.right does not match with type boolean of variable this.includeUpperBound
    10Expression that.right cannot be parameterized, because it has dependencies to/from statements that will be extracted
    11Expression that.includeUpperBound cannot be parameterized, because it has dependencies to/from statements that will be extracted
    12Type double of variable that.right does not match with type boolean of variable that.includeUpperBound
    13Clone fragment #1 returns variables , while Clone fragment #2 returns variables that
    14Not all possible execution flows end in a return statement