if (larg.isTrue()) {
if (result[0]) {
throw JumpException.SPECIAL_JUMP;
} else {
result[0] = true;
}
}
if (block.yield(ctx, larg).isTrue()) {
if (result[0]) {
throw JumpException.SPECIAL_JUMP;
} else {
result[0] = true;
}
}
Clone fragments detected by clone detection tool
File path: /jruby-1.4.0/src/org/jruby/RubyEnumerable.java
|
|
File path: /jruby-1.4.0/src/org/jruby/RubyEnumerable.java
|
Method name: IRubyObject call(ThreadContext, IRubyObject[], Block)
|
|
Method name: IRubyObject call(ThreadContext, IRubyObject[], Block)
|
Number of AST nodes: 4
|
|
Number of AST nodes: 4
|
|
1 | if (larg.isTrue()) {↵ | | 1 | if (block.yield(ctx, larg).isTrue()) {↵
|
2 | if (result[0]) {↵ | | 2 | if (result[0]) {↵
|
3 | throw JumpException.SPECIAL_JUMP;↵ | | 3 | throw JumpException.SPECIAL_JUMP;↵
|
4 | } else {↵ | | 4 | } else {↵
|
5 | result[0] = true;↵ | | 5 | result[0] = true;↵
|
6 | }↵ | | 6 | }↵
|
7 | } | | 7 | }
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 1 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.7 |
Clones location | Clones are in the same java file |
Number of node comparisons | 10 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 4 |
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.8 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
3 | if (larg.isTrue()) | | 3 | if (block.yield(ctx, larg).isTrue()) |
4 | | | 4 | |
5 | throw JumpException.SPECIAL_JUMP; | | 5 | throw JumpException.SPECIAL_JUMP; |
| | | | |
6 | | | 6 | |
Precondition Violations (0)
Row |
Violation |