String closureMethodName = "block_" + script.getAndIncrementInnerIndex() + "$RUBY$" + "__block__"; ChildScopedBodyCompiler19 closureCompiler = new ChildScopedBodyCompiler19(script, closureMethodName, inspector, scope); closureCompiler.beginMethod(args, scope); body.call(closureCompiler); closureCompiler.endBody(); // Done with closure compilation loadThreadContext(); loadSelf(); script.getCacheCompiler().cacheClosure19(this, closureMethodName, arity, scope, hasMultipleArgsHead, argsNodeId, inspector); invokeUtilityMethod("createBlock19", sig(Block.class, params(ThreadContext.class, IRubyObject.class, BlockBody.class)));
String closureMethodName = "block_" + script.getAndIncrementInnerIndex() + "$RUBY$" + "__block__"; ChildScopedBodyCompiler closureCompiler = new ChildScopedBodyCompiler(script, closureMethodName, inspector, scope); closureCompiler.beginMethod(args, scope); body.call(closureCompiler); closureCompiler.endBody(); // Done with closure compilation loadThreadContext(); loadSelf(); script.getCacheCompiler().cacheClosure(this, closureMethodName, arity, scope, hasMultipleArgsHead, argsNodeId, inspector); invokeUtilityMethod("createBlock", sig(Block.class, params(ThreadContext.class, IRubyObject.class, BlockBody.class)));
Clone fragments detected by clone detection tool
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
                params(ThreadContext.class, IRubyObject.class, BlockBody.class)));
Summary
Number of common nesting structure subtrees1
Number of refactorable cases0
Number of non-refactorable cases1
Time elapsed for finding largest common nesting structure subtrees (ms)0.0
Clones locationClones are declared in the same class
Number of node comparisons53
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements9
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 2
    Mapped Statements
    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
    ChildScopedBodyCompiler19 closureCompiler = new ChildScopedBodyCompiler19(script, closureMethodName, inspector, scope);
    2
    ChildScopedBodyCompiler closureCompiler = new ChildScopedBodyCompiler(script, closureMethodName, inspector, scope);
    Differences
    Expression1Expression2Difference
    org.jruby.compiler.impl.ChildScopedBodyCompiler19org.jruby.compiler.impl.ChildScopedBodyCompilerSUBCLASS_TYPE_MISMATCH
    org.jruby.compiler.impl.ChildScopedBodyCompiler19org.jruby.compiler.impl.ChildScopedBodyCompilerSUBCLASS_TYPE_MISMATCH
    org.jruby.compiler.impl.ChildScopedBodyCompiler19org.jruby.compiler.impl.ChildScopedBodyCompilerSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression new ChildScopedBodyCompiler19(script,closureMethodName,inspector,scope) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression new ChildScopedBodyCompiler(script,closureMethodName,inspector,scope) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2
    ChildScopedBodyCompiler closureCompiler = new ChildScopedBodyCompiler(script, closureMethodName, inspector, scope);
    3
    closureCompiler.beginMethod(args, scope);
    3
    closureCompiler.beginMethod(args, scope);
    3
    closureCompiler.beginMethod(args, scope);
    Differences
    Expression1Expression2Difference
    org.jruby.compiler.impl.ChildScopedBodyCompiler19org.jruby.compiler.impl.ChildScopedBodyCompilerSUBCLASS_TYPE_MISMATCH
    3
    closureCompiler.beginMethod(args, scope);
    4
    body.call(closureCompiler);
    4
    body.call(closureCompiler);
    4
    body.call(closureCompiler);
    Differences
    Expression1Expression2Difference
    org.jruby.compiler.impl.ChildScopedBodyCompiler19org.jruby.compiler.impl.ChildScopedBodyCompilerSUBCLASS_TYPE_MISMATCH
    4
    body.call(closureCompiler);
    5
    closureCompiler.endBody();
    5
    closureCompiler.endBody();
    5
    closureCompiler.endBody();
    Differences
    Expression1Expression2Difference
    org.jruby.compiler.impl.ChildScopedBodyCompiler19org.jruby.compiler.impl.ChildScopedBodyCompilerSUBCLASS_TYPE_MISMATCH
    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().cacheClosure19(this, closureMethodName, arity, scope, hasMultipleArgsHead, argsNodeId, inspector);
    8
    script.getCacheCompiler().cacheClosure(this, closureMethodName, arity, scope, hasMultipleArgsHead, argsNodeId, inspector);
    Differences
    Expression1Expression2Difference
    cacheClosure19cacheClosureMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    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
    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
    Expression script.getCacheCompiler().cacheClosure19(this,closureMethodName,arity,scope,hasMultipleArgsHead,argsNodeId,inspector) is a void method call, and thus it cannot be parameterized
    Expression script.getCacheCompiler().cacheClosure(this,closureMethodName,arity,scope,hasMultipleArgsHead,argsNodeId,inspector) is a void method call, and thus it cannot be parameterized
    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("createBlock19", sig(Block.class, params(ThreadContext.class, IRubyObject.class, BlockBody.class)));
    9
    invokeUtilityMethod("createBlock", sig(Block.class, params(ThreadContext.class, IRubyObject.class, BlockBody.class)));
    Differences
    Expression1Expression2Difference
    "createBlock19""createBlock"LITERAL_VALUE_MISMATCH
    9
    invokeUtilityMethod("createBlock", sig(Block.class, params(ThreadContext.class, IRubyObject.class, BlockBody.class)));
    Precondition Violations (6)
    Row Violation
    1Expression new ChildScopedBodyCompiler19(script,closureMethodName,inspector,scope) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression new ChildScopedBodyCompiler(script,closureMethodName,inspector,scope) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression script.getCacheCompiler().cacheClosure19(this,closureMethodName,arity,scope,hasMultipleArgsHead,argsNodeId,inspector) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression script.getCacheCompiler().cacheClosure(this,closureMethodName,arity,scope,hasMultipleArgsHead,argsNodeId,inspector) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression script.getCacheCompiler().cacheClosure19(this,closureMethodName,arity,scope,hasMultipleArgsHead,argsNodeId,inspector) is a void method call, and thus it cannot be parameterized
    6Expression script.getCacheCompiler().cacheClosure(this,closureMethodName,arity,scope,hasMultipleArgsHead,argsNodeId,inspector) is a void method call, and thus it cannot be parameterized