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 == 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;
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/chart/block/FlowArrangement.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 ColumnArrangement)) {
4
        if (!(obj instanceof FlowArrangement)) {
5
            return false;   
5
            return false;   
6
        }
6
        }
7
        ColumnArrangement that = (ColumnArrangement) obj;
7
        FlowArrangement that = (FlowArrangement) obj;
8
        if (this.horizontalAlignment != that.horizontalAlignment) {
8
        if (this.horizontalAlignment != that.horizontalAlignment) {
9
            return false;
9
            return false;
10
        }
10
        }
11
        if (this.verticalAlignment != that.verticalAlignment) {
11
        if (this.verticalAlignment != that.verticalAlignment) {
12
            return false;
12
            return false;
13
        }
13
        }
14
        if (this.horizontalGap != that.horizontalGap) {
14
        if (this.horizontalGap != that.horizontalGap) {
15
            return false;   
15
            return false;   
16
        }
16
        }
17
        if (this.verticalGap != that.verticalGap) {
17
        if (this.verticalGap != that.verticalGap) {
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.8
Clones locationClones are in different classes
Number of node comparisons76
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements14
    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.0
    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 ColumnArrangement))
    3
    if (!(obj instanceof ColumnArrangement))
    3
    if (!(obj instanceof FlowArrangement))
    Differences
    Expression1Expression2Difference
    org.jfree.chart.block.ColumnArrangementorg.jfree.chart.block.FlowArrangementSUBCLASS_TYPE_MISMATCH
    3
    if (!(obj instanceof FlowArrangement))
    4
    return false;
    4
    return false;
    5
    ColumnArrangement that = (ColumnArrangement)obj;
    5
    ColumnArrangement that = (ColumnArrangement)obj;
    5
    FlowArrangement that = (FlowArrangement)obj;
    Differences
    Expression1Expression2Difference
    org.jfree.chart.block.ColumnArrangementorg.jfree.chart.block.FlowArrangementSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.block.ColumnArrangementorg.jfree.chart.block.FlowArrangementSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.block.ColumnArrangementorg.jfree.chart.block.FlowArrangementSUBCLASS_TYPE_MISMATCH
    5
    FlowArrangement that = (FlowArrangement)obj;
    6
    if (this.horizontalAlignment != that.horizontalAlignment)
    6
    if (this.horizontalAlignment != that.horizontalAlignment)
    6
    if (this.horizontalAlignment != that.horizontalAlignment)
    Differences
    Expression1Expression2Difference
    org.jfree.chart.block.ColumnArrangementorg.jfree.chart.block.FlowArrangementSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression that.horizontalAlignment cannot be unified with expression that.horizontalAlignment , because common superclass org.jfree.chart.block.Arrangement does not declare member(s) private org.jfree.ui.HorizontalAlignment horizontalAlignment
    6
    if (this.horizontalAlignment != that.horizontalAlignment)
    7
    return false;
    7
    return false;
    8
    if (this.verticalAlignment != that.verticalAlignment)
    8
    if (this.verticalAlignment != that.verticalAlignment)
    8
    if (this.verticalAlignment != that.verticalAlignment)
    Differences
    Expression1Expression2Difference
    org.jfree.chart.block.ColumnArrangementorg.jfree.chart.block.FlowArrangementSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression that.verticalAlignment cannot be unified with expression that.verticalAlignment , because common superclass org.jfree.chart.block.Arrangement does not declare member(s) private org.jfree.ui.VerticalAlignment verticalAlignment
    8
    if (this.verticalAlignment != that.verticalAlignment)
    9
    return false;
    9
    return false;
    10
    if (this.horizontalGap != that.horizontalGap)
    10
    if (this.horizontalGap != that.horizontalGap)
    10
    if (this.horizontalGap != that.horizontalGap)
    Differences
    Expression1Expression2Difference
    org.jfree.chart.block.ColumnArrangementorg.jfree.chart.block.FlowArrangementSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression that.horizontalGap cannot be unified with expression that.horizontalGap , because common superclass org.jfree.chart.block.Arrangement does not declare member(s) private double horizontalGap
    10
    if (this.horizontalGap != that.horizontalGap)
    11
    return false;
    11
    return false;
    12
    if (this.verticalGap != that.verticalGap)
    12
    if (this.verticalGap != that.verticalGap)
    12
    if (this.verticalGap != that.verticalGap)
    Differences
    Expression1Expression2Difference
    org.jfree.chart.block.ColumnArrangementorg.jfree.chart.block.FlowArrangementSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression that.verticalGap cannot be unified with expression that.verticalGap , because common superclass org.jfree.chart.block.Arrangement does not declare member(s) private double verticalGap
    12
    if (this.verticalGap != that.verticalGap)
    13
    return false;
    13
    return false;
    14
    return true;
    14
    return true;
    Precondition Violations (4)
    Row Violation
    1Expression that.horizontalAlignment cannot be unified with expression that.horizontalAlignment , because common superclass org.jfree.chart.block.Arrangement does not declare member(s) private org.jfree.ui.HorizontalAlignment horizontalAlignment
    2Expression that.verticalAlignment cannot be unified with expression that.verticalAlignment , because common superclass org.jfree.chart.block.Arrangement does not declare member(s) private org.jfree.ui.VerticalAlignment verticalAlignment
    3Expression that.horizontalGap cannot be unified with expression that.horizontalGap , because common superclass org.jfree.chart.block.Arrangement does not declare member(s) private double horizontalGap
    4Expression that.verticalGap cannot be unified with expression that.verticalGap , because common superclass org.jfree.chart.block.Arrangement does not declare member(s) private double verticalGap