if (currentLoopLabels != null) {
issueLoopRedo();
} else if (inNestedMethod) {
invokeUtilityMethod("redoJump", sig(IRubyObject.class));
} else {
// in method body with no containing loop, issue jump error
// load runtime and value, issue jump error
loadRuntime();
invokeUtilityMethod("redoLocalJumpError", sig(IRubyObject.class, Ruby.class));
}
if (currentLoopLabels != null) {
issueLoopRedo();
} else if (inNestedMethod) {
invokeUtilityMethod("redoJump", sig(IRubyObject.class));
} else {
// jump back to the top of the main body of this closure
method.go_to(scopeStart);
}
Clone fragments detected by clone detection tool
File path: /jruby-1.4.0/src/org/jruby/compiler/impl/MethodBodyCompiler.java
|
|
File path: /jruby-1.4.0/src/org/jruby/compiler/impl/ChildScopedBodyCompiler.java
|
Method name: void issueRedoEvent()
|
|
Method name: void issueRedoEvent()
|
Number of AST nodes: 6
|
|
Number of AST nodes: 5
|
|
1 | if (currentLoopLabels != null) {↵ | | 1 | if (currentLoopLabels != null) {↵
|
2 | issueLoopRedo();↵ | | 2 | issueLoopRedo();↵
|
3 | } else if (inNestedMethod) {↵ | | 3 | } else if (inNestedMethod) {↵
|
4 | invokeUtilityMethod("redoJump", sig(IRubyObject.class));↵ | | 4 | invokeUtilityMethod("redoJump", sig(IRubyObject.class));↵
|
5 | } else {↵ | | 5 | } else {↵
|
6 | // in method body with no containing loop, issue jump error↵ | | 6 | // ↵
|
7 | // load runtime and value, issue jump error↵ | | |
|
8 | loadRuntime();↵ | | |
|
9 | invokeUtilityMethod("redoLocalJumpError", sig(IRubyObject.class, Ruby.class)↵ | | 7 | jump back to the top of the main body of this closure↵
|
10 | );↵ | | 8 | method.go_to(scopeStart);↵
|
11 | } | | 9 | }
|
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.2 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 23 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 5 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 1.6 |
Clone type | Type 3 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | if (currentLoopLabels != null) | | 1 | if (currentLoopLabels != null) |
2 | | | 2 | |
3 | | | 3 | |
4 | invokeUtilityMethod("redoJump", sig(IRubyObject.class)); | | 4 | invokeUtilityMethod("redoJump", sig(IRubyObject.class)); |
| | | | |
5 | | | 5 | method.go_to(scopeStart); |
6 | invokeUtilityMethod("redoLocalJumpError", sig(IRubyObject.class, Ruby.class)); | | | |
Precondition Violations (4)
Row |
Violation |
1 | Expression loadRuntime() is a void method call, and thus it cannot be parameterized |
2 | Expression method.go_to(scopeStart) is a void method call, and thus it cannot be parameterized |
3 | Expression loadRuntime() is a void method call, and thus it cannot be parameterized |
4 | Expression method.go_to(scopeStart) is a void method call, and thus it cannot be parameterized |