RubyClass selfClass = pollAndGetClass(context, self); CacheEntry entry = selfClass.searchWithCache(name); if (methodMissing(entry, site.callType(), name, caller)) { return callMethodMissing(entry, site.callType(), context, self, name, arg0); } site.setTarget(createGWT(TEST_1, TARGET_1, FALLBACK_1, entry, site)); return entry.method.call(context, self, selfClass, name, arg0);
RubyClass selfClass = pollAndGetClass(context, self); CacheEntry entry = selfClass.searchWithCache(name); if (methodMissing(entry, site.callType(), name, caller)) { return callMethodMissing(entry, site.callType(), context, self, name, args); } site.setTarget(createGWT(TEST_N, TARGET_N, FALLBACK_N, entry, site)); return entry.method.call(context, self, selfClass, name, args);
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) Method name: IRubyObject fallback(JRubyCallSite, ThreadContext, IRubyObject, IRubyObject, String, IRubyObject[])
Number of AST nodes: 6 Number of AST nodes: 6
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
        if (methodMissing(entry, site.callType(), name, caller)) {
3
        if (methodMissing(entry, site.callType(), name, caller)) {
4
            return callMethodMissing(entry, site.callType(), context, self, name, arg0);
4
            return callMethodMissing(entry, site.callType(), context, self, name, args);
5
        }
5
        }
6
        site.setTarget(createGWT(TEST_1, TARGET_1, FALLBACK_1, entry, site));
6
        site.setTarget(createGWT(TEST_N, TARGET_N, FALLBACK_N, entry, site));
7
        return entry.method.call(context, self, selfClass, name, arg0);
7
        return entry.method.call(context, self, selfClass, name, args);
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.3
Clones locationClones are declared in the same class
Number of node comparisons12
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements6
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)4.3
    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
    if (methodMissing(entry, site.callType(), name, caller))
    3
    if (methodMissing(entry, site.callType(), name, caller))
    4
    return callMethodMissing(entry, site.callType(), context, self, name, arg0);
    4
    return callMethodMissing(entry, site.callType(), context, self, name, arg0);
    4
    return callMethodMissing(entry, site.callType(), context, self, name, args);
    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
    4
    return callMethodMissing(entry, site.callType(), context, self, name, args);
    5
    site.setTarget(createGWT(TEST_1, TARGET_1, FALLBACK_1, entry, site));
    5
    site.setTarget(createGWT(TEST_1, TARGET_1, FALLBACK_1, entry, site));
    5
    site.setTarget(createGWT(TEST_N, TARGET_N, FALLBACK_N, entry, site));
    Differences
    Expression1Expression2Difference
    TEST_1TEST_NVARIABLE_NAME_MISMATCH
    TARGET_1TARGET_NVARIABLE_NAME_MISMATCH
    FALLBACK_1FALLBACK_NVARIABLE_NAME_MISMATCH
    5
    site.setTarget(createGWT(TEST_N, TARGET_N, FALLBACK_N, entry, site));
    6
    return entry.method.call(context, self, selfClass, name, arg0);
    6
    return entry.method.call(context, self, selfClass, name, arg0);
    6
    return entry.method.call(context, self, selfClass, name, args);
    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
    6
    return entry.method.call(context, self, selfClass, name, args);
    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