Tick t = (Tick) obj; if (!ObjectUtilities.equal(this.text, t.text)) { return false; } if (!ObjectUtilities.equal(this.textAnchor, t.textAnchor)) { return false; } if (!ObjectUtilities.equal(this.rotationAnchor, t.rotationAnchor)) { return false; } if (!(this.angle == t.angle)) { return false; } return true;
if (obj == this) { return true; } if (!(obj instanceof BlockContainer)) { return false; } if (!super.equals(obj)) { return false; } BlockContainer that = (BlockContainer) obj; if (!this.arrangement.equals(that.arrangement)) { return false; } if (!this.blocks.equals(that.blocks)) { return false; } return true;
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/axis/Tick.java File path: /jfreechart-1.0.10/src/org/jfree/chart/block/BlockContainer.java
Method name: boolean equals(Object) Method name: boolean equals(Object)
Number of AST nodes: 10 Number of AST nodes: 12
1
Tick t = (Tick) obj
1
if (obj == this) {
2
;   
2
            return true;   
3
    
3
        }
4
        if (!ObjectUtilities.equal(this.text, t.text)) {
4
        if (!(obj instanceof BlockContainer)) {
5
                return false;   
5
            return false;   
6
            }
6
        }
7
            if (!ObjectUtilities.equal(this.textAnchor, t.textAnchor)) {
7
        if (!super.equals(obj)) {
8
                return false;   
8
            return false;   
9
        
9
        }
10
    }
10
    
11
            if (!ObjectUtilities
11
    BlockContainer that = (BlockContainer) obj;
12
.equal(this.rotationAnchor, t.rotationAnchor)) {
12
        if (!this.arrangement.equals(that.arrangement)) {
13
                return false;   
13
            return false;   
14
            }
14
        }
15
            if (!(this.angle == t.angle)) {
15
        if (!this.blocks.equals(that.blocks)) {
16
                return false;   
16
            return false;   
17
            }
17
        
18
    
18
}
19
        return true;
19
        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)1.3
Clones locationClones are in different classes
Number of node comparisons54
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements9
    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.7
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    4
    Tick t = (Tick)obj;
                                            
    5
    if (!ObjectUtilities.equal(this.text, t.text))
    5
    if (!ObjectUtilities.equal(this.text, t.text))
    3
    if (!(obj instanceof BlockContainer))
    Differences
    Expression1Expression2Difference
    ObjectUtilities.equal(this.text,t.text)(obj instanceof BlockContainer)TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression ObjectUtilities.equal(this.text,t.text) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3
    if (!(obj instanceof BlockContainer))
    6
    return false;
    4
    return false;
    7
    if (!ObjectUtilities.equal(this.textAnchor, t.textAnchor))
    7
    if (!ObjectUtilities.equal(this.textAnchor, t.textAnchor))
    5
    if (!super.equals(obj))
    Differences
    Expression1Expression2Difference
    ObjectUtilities.equal(this.textAnchor,t.textAnchor)super.equals(obj)TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression ObjectUtilities.equal(this.textAnchor,t.textAnchor) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Super method call if(!super.equals(obj)) cannot be extracted from method
    5
    if (!super.equals(obj))
    8
    return false;
    6
    return false;
                                                                                          
    7
    BlockContainer that = (BlockContainer)obj;
    9
    if (!ObjectUtilities.equal(this.rotationAnchor, t.rotationAnchor))
    9
    if (!ObjectUtilities.equal(this.rotationAnchor, t.rotationAnchor))
    8
    if (!this.arrangement.equals(that.arrangement))
    Differences
    Expression1Expression2Difference
    ObjectUtilities.equal(this.rotationAnchor,t.rotationAnchor)this.arrangement.equals(that.arrangement)TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression ObjectUtilities.equal(this.rotationAnchor,t.rotationAnchor) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression this.arrangement.equals(that.arrangement) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8
    if (!this.arrangement.equals(that.arrangement))
    10
    return false;
    9
    return false;
    11
    if (!(this.angle == t.angle))
    11
    if (!(this.angle == t.angle))
    10
    if (!this.blocks.equals(that.blocks))
    Differences
    Expression1Expression2Difference
    (this.angle == t.angle)this.blocks.equals(that.blocks)TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression (this.angle == t.angle) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression this.blocks.equals(that.blocks) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10
    if (!this.blocks.equals(that.blocks))
    12
    return false;
    11
    return false;
    13
    return true;
    12
    return true;
    Precondition Violations (8)
    Row Violation
    1Expression ObjectUtilities.equal(this.text,t.text) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression ObjectUtilities.equal(this.textAnchor,t.textAnchor) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Super method call if(!super.equals(obj)) cannot be extracted from method
    4Expression ObjectUtilities.equal(this.rotationAnchor,t.rotationAnchor) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression this.arrangement.equals(that.arrangement) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression (this.angle == t.angle) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression this.blocks.equals(that.blocks) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Not all possible execution flows end in a return statement