if(this == other) { return true; } if(!(other instanceof Block)) { return false; } Block bOther = (Block)other; return this.binding.equals(bOther.binding) && this.body == bOther.body;
if (this == other) { return true; } if (other == null || !(other instanceof Pair)) { return false; } Pair pair = (Pair) other; return a == pair.a && b == pair.b;
Clone fragments detected by clone detection tool
File path: /jruby-1.4.0/src/org/jruby/runtime/Block.java File path: /jruby-1.4.0/src/org/jruby/util/RecursiveComparator.java
Method name: boolean equals(Object) Method name: boolean equals(Object)
Number of AST nodes: 6 Number of AST nodes: 6
1
if(this == other) {
1
if (this == other) {
2
            return true;
2
                return true;
3
        }
3
            }
4
        if(!(other instanceof Block)) {
4
            if (other == null || !(other instanceof Pair)) {
5
            return false;
5
                return false;
6
        }
6
            }
7
        Block bOther = (Block)other;
7
            Pair pair = (Pair) other;
8
        return this.binding.equals(bOther.binding) &&
8
            return 
9
            this.body == bOther.body;
9
a == pair.a && b == pair.b;
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)0.3
Clones locationClones are in different classes
Number of node comparisons7
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)0.3
    Clone typeType 1
    Mapped Statements
    ID Statement ID Statement
    1
    if (this == other)
    1
    if (this == other)
    2
    return true;
    2
    return true;
    2
    return true;
    Preondition Violations
    Conditional return true;
    Conditional return true;
    2
    return true;
    Precondition Violations (2)
    Row Violation
    1Conditional return true;
    2Conditional return true;