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;
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 1 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.3 |
Clones location | Clones are in different classes |
Number of node comparisons | 7 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 2 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 0.3 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | if (this == other) | | 1 | if (this == other) |
2 | | | 2 | |
Precondition Violations (2)
Row |
Violation |
1 | Conditional return true; |
2 | Conditional return true; |