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 == 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;
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/chart/block/ColumnArrangement.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 AxisSpace)) {
4
        if (!(obj instanceof ColumnArrangement)) {
5
            return false;
5
            return false;   
6
        }
6
        }
7
        AxisSpace that = (AxisSpace) obj;
7
        
8
        if (this.top != that.top
8
ColumnArrangement that = (ColumnArrangement) obj;
9
) {
9
        if (this.horizontalAlignment != that.horizontalAlignment) {
10
            return false;
10
            return false;
11
        }   
11
        }
12
        if (this.bottom != that.bottom) {
12
        if (this.verticalAlignment != that.verticalAlignment) {
13
            return false;
13
            return false;
14
        }
14
        }
15
        if (this.left != that.left) {
15
        if (this.horizontalGap != that.horizontalGap) {
16
            return false;
16
            return false;   
17
        }
17
        }
18
        if (this.right != that.right) {
18
        if (this.verticalGap != that.verticalGap) {
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)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.4
    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 AxisSpace))
    3
    if (!(obj instanceof AxisSpace))
    3
    if (!(obj instanceof ColumnArrangement))
    Differences
    Expression1Expression2Difference
    org.jfree.chart.axis.AxisSpaceorg.jfree.chart.block.ColumnArrangementVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jfree.chart.axis.AxisSpace does not match with type org.jfree.chart.block.ColumnArrangement
    • Make classes org.jfree.chart.axis.AxisSpace and org.jfree.chart.block.ColumnArrangement extend a common superclass
    3
    if (!(obj instanceof ColumnArrangement))
    4
    return false;
    4
    return false;
                                                                                                      
    5
    ColumnArrangement that = (ColumnArrangement)obj;
    5
    AxisSpace that = (AxisSpace)obj;
                                                                      
    6
    if (this.top != that.top)
    6
    if (this.top != that.top)
    10
    if (this.horizontalGap != that.horizontalGap)
    Differences
    Expression1Expression2Difference
    tophorizontalGapVARIABLE_NAME_MISMATCH
    org.jfree.chart.axis.AxisSpaceorg.jfree.chart.block.ColumnArrangementVARIABLE_TYPE_MISMATCH
    tophorizontalGapVARIABLE_NAME_MISMATCH
    Preondition Violations
    Type double of variable that.top does not match with type double of variable that.horizontalGap
    • Make classes org.jfree.chart.axis.AxisSpace and org.jfree.chart.block.ColumnArrangement extend a common superclass
    Expression that.top cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.horizontalGap cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10
    if (this.horizontalGap != that.horizontalGap)
    7
    return false;
    11
    return false;
    8
    if (this.bottom != that.bottom)
    8
    if (this.bottom != that.bottom)
    12
    if (this.verticalGap != that.verticalGap)
    Differences
    Expression1Expression2Difference
    bottomverticalGapVARIABLE_NAME_MISMATCH
    org.jfree.chart.axis.AxisSpaceorg.jfree.chart.block.ColumnArrangementVARIABLE_TYPE_MISMATCH
    bottomverticalGapVARIABLE_NAME_MISMATCH
    Preondition Violations
    Type double of variable that.bottom does not match with type double of variable that.verticalGap
    • Make classes org.jfree.chart.axis.AxisSpace and org.jfree.chart.block.ColumnArrangement extend a common superclass
    Expression that.bottom cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.verticalGap cannot be parameterized, because it has dependencies to/from statements that will be extracted
    12
    if (this.verticalGap != that.verticalGap)
    9
    return false;
    13
    return false;
    10
    if (this.left != that.left)
    10
    if (this.left != that.left)
    8
    if (this.verticalAlignment != that.verticalAlignment)
    Differences
    Expression1Expression2Difference
    leftverticalAlignmentVARIABLE_NAME_MISMATCH
    doubleorg.jfree.ui.VerticalAlignmentVARIABLE_TYPE_MISMATCH
    org.jfree.chart.axis.AxisSpaceorg.jfree.chart.block.ColumnArrangementVARIABLE_TYPE_MISMATCH
    leftverticalAlignmentVARIABLE_NAME_MISMATCH
    doubleorg.jfree.ui.VerticalAlignmentVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type double of variable this.left does not match with type org.jfree.ui.VerticalAlignment of variable this.verticalAlignment
    Type double of variable that.left does not match with type org.jfree.ui.VerticalAlignment of variable that.verticalAlignment
    • Make classes org.jfree.chart.axis.AxisSpace and org.jfree.chart.block.ColumnArrangement extend a common superclass
    Expression that.left cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.verticalAlignment 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 org.jfree.ui.VerticalAlignment of variable that.verticalAlignment
    8
    if (this.verticalAlignment != that.verticalAlignment)
    11
    return false;
    9
    return false;
    12
    if (this.right != that.right)
    12
    if (this.right != that.right)
    6
    if (this.horizontalAlignment != that.horizontalAlignment)
    Differences
    Expression1Expression2Difference
    righthorizontalAlignmentVARIABLE_NAME_MISMATCH
    doubleorg.jfree.ui.HorizontalAlignmentVARIABLE_TYPE_MISMATCH
    org.jfree.chart.axis.AxisSpaceorg.jfree.chart.block.ColumnArrangementVARIABLE_TYPE_MISMATCH
    righthorizontalAlignmentVARIABLE_NAME_MISMATCH
    doubleorg.jfree.ui.HorizontalAlignmentVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type double of variable this.right does not match with type org.jfree.ui.HorizontalAlignment of variable this.horizontalAlignment
    Type double of variable that.right does not match with type org.jfree.ui.HorizontalAlignment of variable that.horizontalAlignment
    • Make classes org.jfree.chart.axis.AxisSpace and org.jfree.chart.block.ColumnArrangement extend a common superclass
    Expression that.right cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.horizontalAlignment 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 org.jfree.ui.HorizontalAlignment of variable that.horizontalAlignment
    6
    if (this.horizontalAlignment != that.horizontalAlignment)
    13
    return false;
    7
    return false;
    14
    return true;
    14
    return true;
    Precondition Violations (17)
    Row Violation
    1Type org.jfree.chart.axis.AxisSpace does not match with type org.jfree.chart.block.ColumnArrangement
    2Type double of variable that.top does not match with type double of variable that.horizontalGap
    3Expression that.top cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression that.horizontalGap cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Type double of variable that.bottom does not match with type double of variable that.verticalGap
    6Expression that.bottom cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression that.verticalGap cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Type double of variable this.left does not match with type org.jfree.ui.VerticalAlignment of variable this.verticalAlignment
    9Type double of variable that.left does not match with type org.jfree.ui.VerticalAlignment of variable that.verticalAlignment
    10Expression that.left cannot be parameterized, because it has dependencies to/from statements that will be extracted
    11Expression that.verticalAlignment cannot be parameterized, because it has dependencies to/from statements that will be extracted
    12Type double of variable that.left does not match with type org.jfree.ui.VerticalAlignment of variable that.verticalAlignment
    13Type double of variable this.right does not match with type org.jfree.ui.HorizontalAlignment of variable this.horizontalAlignment
    14Type double of variable that.right does not match with type org.jfree.ui.HorizontalAlignment of variable that.horizontalAlignment
    15Expression that.right cannot be parameterized, because it has dependencies to/from statements that will be extracted
    16Expression that.horizontalAlignment cannot be parameterized, because it has dependencies to/from statements that will be extracted
    17Type double of variable that.right does not match with type org.jfree.ui.HorizontalAlignment of variable that.horizontalAlignment