File path: /jruby-1.4.0/src/org/jruby/compiler/impl/BaseBodyCompiler.java | File path: /jruby-1.4.0/src/org/jruby/compiler/impl/BaseBodyCompiler.java | |||
Method name: void createNewClosure19(int, StaticScope, int, CompilerCallback, CompilerCallback, boolean, NodeType, ASTInspector)
|
Method name: void createNewClosure(int, StaticScope, int, CompilerCallback, CompilerCallback, boolean, NodeType, ASTInspector)
|
|||
Number of AST nodes: 9 | Number of AST nodes: 9 | |||
1 | String closureMethodName = "block_" + script.getAndIncrementInnerIndex() + "$RUBY$" + "__block__";↵ | 1 | String closureMethodName = "block_" + script.getAndIncrementInnerIndex() + "$RUBY$" + "__block__";↵ | |
2 | ChildScopedBodyCompiler19 closureCompiler = new ChildScopedBodyCompiler19(script, closureMethodName, inspector, scope);↵ | 2 | ChildScopedBodyCompiler closureCompiler = new ChildScopedBodyCompiler(script, closureMethodName, inspector, scope);↵ | |
3 | closureCompiler.beginMethod(args, scope);↵ | 3 | closureCompiler.beginMethod(args, scope);↵ | |
4 | body.call(closureCompiler);↵ | 4 | body.call(closureCompiler);↵ | |
5 | closureCompiler.endBody();↵ | 5 | closureCompiler.endBody();↵ | |
6 | // Done with closure compilation↵ | 6 | // Done with closure compilation↵ | |
7 | loadThreadContext();↵ | 7 | loadThreadContext();↵ | |
8 | loadSelf();↵ | 8 | loadSelf();↵ | |
9 | script.getCacheCompiler().cacheClosure19(this, closureMethodName, arity, scope, hasMultipleArgsHead, argsNodeId, inspector);↵ | 9 | script.getCacheCompiler().cacheClosure(this, closureMethodName, arity, scope, hasMultipleArgsHead, argsNodeId, inspector);↵ | |
10 | invokeUtilityMethod("createBlock19", sig(Block.class,↵ | 10 | invokeUtilityMethod("createBlock", sig(Block.class,↵ | |
11 | params(ThreadContext.class, IRubyObject.class, BlockBody.class))); | 11 |
| |
See real code fragment | See real code fragment |
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.0 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 53 |
Number of mapped statements | 9 |
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.0 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | String closureMethodName = "block_" + script.getAndIncrementInnerIndex() + "$RUBY$" + "__block__"; | 1 | String closureMethodName = "block_" + script.getAndIncrementInnerIndex() + "$RUBY$" + "__block__"; | |||||||||||||||||||
2 | ChildScopedBodyCompiler19 closureCompiler = new ChildScopedBodyCompiler19(script, closureMethodName, inspector, scope); |
| 2 | ChildScopedBodyCompiler closureCompiler = new ChildScopedBodyCompiler(script, closureMethodName, inspector, scope); | ||||||||||||||||||
3 | closureCompiler.beginMethod(args, scope); |
| 3 | closureCompiler.beginMethod(args, scope); | ||||||||||||||||||
4 | body.call(closureCompiler); |
| 4 | body.call(closureCompiler); | ||||||||||||||||||
5 | closureCompiler.endBody(); |
| 5 | closureCompiler.endBody(); | ||||||||||||||||||
6 | loadThreadContext(); | 6 | loadThreadContext(); | |||||||||||||||||||
7 | loadSelf(); | 7 | loadSelf(); | |||||||||||||||||||
8 | script.getCacheCompiler().cacheClosure19(this, closureMethodName, arity, scope, hasMultipleArgsHead, argsNodeId, inspector); |
| 8 | script.getCacheCompiler().cacheClosure(this, closureMethodName, arity, scope, hasMultipleArgsHead, argsNodeId, inspector); | ||||||||||||||||||
9 | invokeUtilityMethod("createBlock19", sig(Block.class, params(ThreadContext.class, IRubyObject.class, BlockBody.class))); |
| 9 | invokeUtilityMethod("createBlock", sig(Block.class, params(ThreadContext.class, IRubyObject.class, BlockBody.class))); |
Row | Violation |
---|---|
1 | Expression new ChildScopedBodyCompiler19(script,closureMethodName,inspector,scope) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression new ChildScopedBodyCompiler(script,closureMethodName,inspector,scope) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression script.getCacheCompiler().cacheClosure19(this,closureMethodName,arity,scope,hasMultipleArgsHead,argsNodeId,inspector) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Expression script.getCacheCompiler().cacheClosure(this,closureMethodName,arity,scope,hasMultipleArgsHead,argsNodeId,inspector) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
5 | Expression script.getCacheCompiler().cacheClosure19(this,closureMethodName,arity,scope,hasMultipleArgsHead,argsNodeId,inspector) is a void method call, and thus it cannot be parameterized |
6 | Expression script.getCacheCompiler().cacheClosure(this,closureMethodName,arity,scope,hasMultipleArgsHead,argsNodeId,inspector) is a void method call, and thus it cannot be parameterized |