RubyClass selfClass = pollAndGetClass(context, self); CacheEntry entry = selfClass.searchWithCache(name); try { if (methodMissing(entry, site.callType(), name, caller)) { return callMethodMissing(entry, site.callType(), context, self, name, arg0, block); } site.setTarget(createGWT(TEST_1_B, TARGET_1_B, FALLBACK_1_B, entry, site)); return entry.method.call(context, self, selfClass, name, arg0, block); } catch (JumpException.BreakJump bj) { return handleBreakJump(context, bj); } catch (JumpException.RetryJump rj) { return retryJumpError(context); } finally { block.escape(); }
RubyClass selfClass = pollAndGetClass(context, self); CacheEntry entry = selfClass.searchWithCache(name); try { if (methodMissing(entry, site.callType(), name, caller)) { return callMethodMissing(entry, site.callType(), context, self, name, args, block); } site.setTarget(createGWT(TEST_N_B, TARGET_N_B, FALLBACK_N_B, entry, site)); return entry.method.call(context, self, selfClass, name, args, block); } catch (JumpException.BreakJump bj) { return handleBreakJump(context, bj); } catch (JumpException.RetryJump rj) { return retryJumpError(context); } finally { block.escape(); }
Clone fragments detected by clone detection tool
File path: /jruby-1.4.0/src/org/jruby/runtime/invokedynamic/InvokeDynamicSupport.java File path: /jruby-1.4.0/src/org/jruby/runtime/invokedynamic/InvokeDynamicSupport.java
Method name: IRubyObject fallback(JRubyCallSite, ThreadContext, IRubyObject, IRubyObject, String, IRubyObject, Block) Method name: IRubyObject fallback(JRubyCallSite, ThreadContext, IRubyObject, IRubyObject, String, IRubyObject[], Block)
Number of AST nodes: 7 Number of AST nodes: 7
1
RubyClass selfClass = pollAndGetClass(context, self);
1
RubyClass selfClass = pollAndGetClass(context, self);
2
        CacheEntry entry = selfClass.searchWithCache(name);
2
        CacheEntry entry = selfClass.searchWithCache(name);
3
        try {
3
        try {
4
            if (methodMissing(entry, site.callType(), name, caller)) {
4
            if (methodMissing(entry, site.callType(), name, caller)) {
5
                return callMethodMissing(entry, site.callType(), context, self, name, arg0, block);
5
                return callMethodMissing(entry, site.callType(), context, self, name, args, block);
6
            }
6
            }
7
            site.setTarget(createGWT(TEST_1_B, TARGET_1_B, FALLBACK_1_B, entry, site));
7
            site.setTarget(createGWT(TEST_N_B, TARGET_N_B, FALLBACK_N_B, entry, site));
8
            return entry.method.call(context, self, selfClass, name, arg0, block);
8
            return entry.method.call(context, self, selfClass, name, args, block);
9
        } catch (JumpException.BreakJump bj) {
9
        } catch (JumpException.BreakJump bj) {
10
            return handleBreakJump(context, bj);
10
            return handleBreakJump(context, bj);
11
        } catch (JumpException.RetryJump rj) {
11
        } catch (JumpException.RetryJump rj) {
12
            return retryJumpError(context);
12
            return retryJumpError(context);
13
        } finally {
13
        } finally {
14
            block.escape();
14
            block.escape();
15
        }
15
        }
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.6
Clones locationClones are declared in the same class
Number of node comparisons17
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements7
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)3.7
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    RubyClass selfClass = pollAndGetClass(context, self);
    1
    RubyClass selfClass = pollAndGetClass(context, self);
    2
    CacheEntry entry = selfClass.searchWithCache(name);
    2
    CacheEntry entry = selfClass.searchWithCache(name);
    3
    try
    3
    try
    4
    if (methodMissing(entry, site.callType(), name, caller))
    4
    if (methodMissing(entry, site.callType(), name, caller))
    5
    return callMethodMissing(entry, site.callType(), context, self, name, arg0, block);
    5
    return callMethodMissing(entry, site.callType(), context, self, name, arg0, block);
    5
    return callMethodMissing(entry, site.callType(), context, self, name, args, block);
    Differences
    Expression1Expression2Difference
    arg0argsVARIABLE_NAME_MISMATCH
    org.jruby.runtime.builtin.IRubyObjectorg.jruby.runtime.builtin.IRubyObject[]VARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jruby.runtime.builtin.IRubyObject of variable arg0 does not match with type org.jruby.runtime.builtin.IRubyObject[] of variable args
    • Make classes org.jruby.runtime.builtin.IRubyObject and org.jruby.runtime.builtin.IRubyObject[] extend a common superclass
    5
    return callMethodMissing(entry, site.callType(), context, self, name, args, block);
    6
    site.setTarget(createGWT(TEST_1_B, TARGET_1_B, FALLBACK_1_B, entry, site));
    6
    site.setTarget(createGWT(TEST_1_B, TARGET_1_B, FALLBACK_1_B, entry, site));
    6
    site.setTarget(createGWT(TEST_N_B, TARGET_N_B, FALLBACK_N_B, entry, site));
    Differences
    Expression1Expression2Difference
    TEST_1_BTEST_N_BVARIABLE_NAME_MISMATCH
    TARGET_1_BTARGET_N_BVARIABLE_NAME_MISMATCH
    FALLBACK_1_BFALLBACK_N_BVARIABLE_NAME_MISMATCH
    6
    site.setTarget(createGWT(TEST_N_B, TARGET_N_B, FALLBACK_N_B, entry, site));
    7
    return entry.method.call(context, self, selfClass, name, arg0, block);
    7
    return entry.method.call(context, self, selfClass, name, arg0, block);
    7
    return entry.method.call(context, self, selfClass, name, args, block);
    Differences
    Expression1Expression2Difference
    arg0argsVARIABLE_NAME_MISMATCH
    org.jruby.runtime.builtin.IRubyObjectorg.jruby.runtime.builtin.IRubyObject[]VARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jruby.runtime.builtin.IRubyObject of variable arg0 does not match with type org.jruby.runtime.builtin.IRubyObject[] of variable args
    • Make classes org.jruby.runtime.builtin.IRubyObject and org.jruby.runtime.builtin.IRubyObject[] extend a common superclass
    7
    return entry.method.call(context, self, selfClass, name, args, block);
    Precondition Violations (2)
    Row Violation
    1Type org.jruby.runtime.builtin.IRubyObject of variable arg0 does not match with type org.jruby.runtime.builtin.IRubyObject[] of variable args
    2Type org.jruby.runtime.builtin.IRubyObject of variable arg0 does not match with type org.jruby.runtime.builtin.IRubyObject[] of variable args