CacheEntry entry = selfType != null ? selfType.searchWithCache(name) : CacheEntry.NULL_CACHE; DynamicMethod method = entry.method; if (methodMissing(method, caller)) { return callMethodMissing(context, self, name, method, args); } lastName = name; cache = entry; return method.call(context, self, selfType, name, args);
CacheEntry entry = selfType != null ? selfType.searchWithCache(name) : CacheEntry.NULL_CACHE; DynamicMethod method = entry.method; if (methodMissing(method, caller)) { return callMethodMissing(context, self, name, method, arg); } lastName = name; cache = entry; return method.call(context, self, selfType, name, arg);
Clone fragments detected by clone detection tool
File path: /jruby-1.4.0/src/org/jruby/runtime/callsite/SuperCallSite.java File path: /jruby-1.4.0/src/org/jruby/runtime/callsite/SuperCallSite.java
Method name: IRubyObject cacheAndCall(IRubyObject, RubyClass, IRubyObject[], ThreadContext, IRubyObject, String) Method name: IRubyObject cacheAndCall(IRubyObject, RubyClass, ThreadContext, IRubyObject, String, IRubyObject)
Number of AST nodes: 7 Number of AST nodes: 7
1
CacheEntry entry = selfType != null ? selfType.searchWithCache(name) : CacheEntry.NULL_CACHE;
1
CacheEntry entry = selfType != null ? selfType.searchWithCache(name) : CacheEntry.NULL_CACHE;
2
        DynamicMethod method = entry.method;
2
        DynamicMethod method = entry.method;
3
        if (methodMissing(method, caller)) {
3
        if (methodMissing(method, caller)) {
4
            return callMethodMissing(context, self, name, method, args);
4
            return callMethodMissing(context, self, name, method, arg);
5
        }
5
        }
6
        lastName = name;
6
        lastName = name;
7
        cache = entry;
7
        cache = entry;
8
        return method.call(context, self, selfType, name, args);
8
        return method.call(context, self, selfType, name, arg);
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.2
Clones locationClones are declared in the same class
Number of node comparisons16
  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)5.8
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    CacheEntry entry = selfType != null ? selfType.searchWithCache(name) : CacheEntry.NULL_CACHE;
    1
    CacheEntry entry = selfType != null ? selfType.searchWithCache(name) : CacheEntry.NULL_CACHE;
    2
    DynamicMethod method = entry.method;
    2
    DynamicMethod method = entry.method;
    3
    if (methodMissing(method, caller))
    3
    if (methodMissing(method, caller))
    4
    return callMethodMissing(context, self, name, method, args);
    4
    return callMethodMissing(context, self, name, method, args);
    4
    return callMethodMissing(context, self, name, method, arg);
    Differences
    Expression1Expression2Difference
    argsargVARIABLE_NAME_MISMATCH
    org.jruby.runtime.builtin.IRubyObject[]org.jruby.runtime.builtin.IRubyObjectVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jruby.runtime.builtin.IRubyObject[] of variable args does not match with type org.jruby.runtime.builtin.IRubyObject of variable arg
    • Make classes org.jruby.runtime.builtin.IRubyObject[] and org.jruby.runtime.builtin.IRubyObject extend a common superclass
    4
    return callMethodMissing(context, self, name, method, arg);
    5
    lastName = name;
    5
    lastName = name;
    6
    cache = entry;
    6
    cache = entry;
    7
    return method.call(context, self, selfType, name, args);
    7
    return method.call(context, self, selfType, name, args);
    7
    return method.call(context, self, selfType, name, arg);
    Differences
    Expression1Expression2Difference
    argsargVARIABLE_NAME_MISMATCH
    org.jruby.runtime.builtin.IRubyObject[]org.jruby.runtime.builtin.IRubyObjectVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jruby.runtime.builtin.IRubyObject[] of variable args does not match with type org.jruby.runtime.builtin.IRubyObject of variable arg
    • Make classes org.jruby.runtime.builtin.IRubyObject[] and org.jruby.runtime.builtin.IRubyObject extend a common superclass
    7
    return method.call(context, self, selfType, name, arg);
    Precondition Violations (2)
    Row Violation
    1Type org.jruby.runtime.builtin.IRubyObject[] of variable args does not match with type org.jruby.runtime.builtin.IRubyObject of variable arg
    2Type org.jruby.runtime.builtin.IRubyObject[] of variable args does not match with type org.jruby.runtime.builtin.IRubyObject of variable arg