RubyModule klazz = context.getFrameKlazz(); String name = context.getFrameName(); RubyClass selfType = pollAndGetClass(context, self, klazz, name); CacheEntry myCache = cache; if (name == lastName && selfType != null && myCache.typeOk(selfType)) { return myCache.method.call(context, self, selfType, name, arg1); } return cacheAndCall(caller, selfType, context, self, name, arg1);
RubyModule klazz = context.getFrameKlazz(); String name = context.getFrameName(); RubyClass selfType = pollAndGetClass(context, self, klazz, name); CacheEntry myCache = cache; if (name == lastName && selfType != null && myCache.typeOk(selfType)) { return myCache.method.call(context, self, selfType, name, arg1, block); } return cacheAndCall(caller, selfType, block, context, self, name, arg1);
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 call(ThreadContext, IRubyObject, IRubyObject, IRubyObject) Method name: IRubyObject callBlock(ThreadContext, IRubyObject, IRubyObject, IRubyObject, Block)
Number of AST nodes: 7 Number of AST nodes: 7
1
RubyModule klazz = context.getFrameKlazz();
1
RubyModule klazz = context.getFrameKlazz();
2
        String name = context.getFrameName();
2
        String name = context.getFrameName();
3
        RubyClass selfType = pollAndGetClass(context, self, klazz, name);
3
        RubyClass selfType = pollAndGetClass(context, self, klazz, name);
4
        CacheEntry myCache = cache;
4
        CacheEntry myCache = cache;
5
        if (name == lastName && selfType != null && myCache.typeOk(selfType)) {
5
        if (name == lastName && selfType != null && myCache.typeOk(selfType)) {
6
            return myCache.method.call(context, self, selfType, name, arg1);
6
            return myCache.method.call(context, self, selfType, name, arg1, block);
7
        }
7
        }
8
        return cacheAndCall(caller, selfType, context, self, name, arg1);
8
        return cacheAndCall(caller, selfType, block, context, self, name, arg1);
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 comparisons15
  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)167613.9
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    RubyModule klazz = context.getFrameKlazz();
    1
    RubyModule klazz = context.getFrameKlazz();
    2
    String name = context.getFrameName();
    2
    String name = context.getFrameName();
    3
    RubyClass selfType = pollAndGetClass(context, self, klazz, name);
    3
    RubyClass selfType = pollAndGetClass(context, self, klazz, name);
    4
    CacheEntry myCache = cache;
    4
    CacheEntry myCache = cache;
    5
    if (name == lastName && selfType != null && myCache.typeOk(selfType))
    5
    if (name == lastName && selfType != null && myCache.typeOk(selfType))
    6
    return myCache.method.call(context, self, selfType, name, arg1);
    6
    return myCache.method.call(context, self, selfType, name, arg1);
    6
    return myCache.method.call(context, self, selfType, name, arg1, block);
    Differences
    Expression1Expression2Difference
    myCache.method.call(context,self,selfType,name,arg1)myCache.method.call(context,self,selfType,name,arg1,block)ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression myCache.method.call(context,self,selfType,name,arg1) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression myCache.method.call(context,self,selfType,name,arg1,block) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6
    return myCache.method.call(context, self, selfType, name, arg1, block);
    7
    return cacheAndCall(caller, selfType, context, self, name, arg1);
    7
    return cacheAndCall(caller, selfType, context, self, name, arg1);
    7
    return cacheAndCall(caller, selfType, block, context, self, name, arg1);
    Differences
    Expression1Expression2Difference
    cacheAndCall(caller,selfType,context,self,name,arg1)cacheAndCall(caller,selfType,block,context,self,name,arg1)ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression cacheAndCall(caller,selfType,context,self,name,arg1) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression cacheAndCall(caller,selfType,block,context,self,name,arg1) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7
    return cacheAndCall(caller, selfType, block, context, self, name, arg1);
    Precondition Violations (4)
    Row Violation
    1Expression myCache.method.call(context,self,selfType,name,arg1) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression myCache.method.call(context,self,selfType,name,arg1,block) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression cacheAndCall(caller,selfType,context,self,name,arg1) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression cacheAndCall(caller,selfType,block,context,self,name,arg1) cannot be parameterized, because it has dependencies to/from statements that will be extracted