while (true) {
try {
return bodyNode.interpret(context.getRuntime(), context, self, Block.NULL_BLOCK);
} catch (JumpException.RedoJump rj) {
context.pollThreadEvents();
// do nothing, allow loop to redo
} catch (StackOverflowError soe) {
throw context.getRuntime().newSystemStackError("stack level too deep", soe);
}
}
while (true) {
try {
return body.interpret(context.getRuntime(), context, self, Block.NULL_BLOCK);
} catch (JumpException.RedoJump rj) {
context.pollThreadEvents();
// do nothing, allow loop to redo
} catch (StackOverflowError soe) {
throw context.getRuntime().newSystemStackError("stack level too deep", soe);
}
}
Clone fragments detected by clone detection tool
File path: /jruby-1.4.0/src/org/jruby/runtime/InterpretedBlock.java
|
|
File path: /jruby-1.4.0/src/org/jruby/runtime/Interpreted19Block.java
|
Method name: IRubyObject evalBlockBody(ThreadContext, IRubyObject)
|
|
Method name: IRubyObject evalBlockBody(ThreadContext, IRubyObject)
|
Number of AST nodes: 3
|
|
Number of AST nodes: 3
|
|
1 | while (true) {↵ | | 1 | while (true) {↵
|
2 | try {↵ | | 2 | try {↵
|
3 | return bodyNode.interpret(context.getRuntime(), context, self, Block.NULL_BLOCK);↵ | | 3 | return body.interpret(context.getRuntime(), context, self, Block.NULL_BLOCK);↵
|
4 | } catch (JumpException.RedoJump rj) {↵ | | 4 | } catch (JumpException.RedoJump rj) {↵
|
5 | context.pollThreadEvents();↵ | | 5 | context.pollThreadEvents();↵
|
6 | // do nothing, allow loop to redo↵ | | 6 | // do nothing, allow loop to redo↵
|
7 | } catch (StackOverflowError soe) {↵ | | 7 | } catch (StackOverflowError soe) {↵
|
8 | throw context.getRuntime().newSystemStackError("stack level too deep", soe);↵ | | 8 | throw context.getRuntime().newSystemStackError("stack level too deep", soe);↵
|
9 | }↵ | | 9 | }↵
|
10 | } | | 10 | }
|
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.5 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 5 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 3 |
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.7 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | while (true) | | 1 | while (true) |
2 | | | 2 | |
3 | return bodyNode.interpret(context.getRuntime(), context, self, Block.NULL_BLOCK); | | 3 | return body.interpret(context.getRuntime(), context, self, Block.NULL_BLOCK); |
Precondition Violations (0)
Row |
Violation |