checkSuperDisabledOrOutOfMethod(context); RubyModule klazz = context.getFrameKlazz(); String name = context.getFrameName(); RubyClass superClass = findImplementerIfNecessary(self.getMetaClass(), klazz).getSuperClass(); DynamicMethod method = superClass != null ? superClass.searchMethod(name) : UndefinedMethod.INSTANCE; if (method.isUndefined()) { return callMethodMissing(context, self, method.getVisibility(), name, CallType.SUPER, arg0, arg1, block); } return method.call(context, self, superClass, name, arg0, arg1, block);
checkSuperDisabledOrOutOfMethod(context); RubyModule klazz = context.getFrameKlazz(); String name = context.getFrameName(); RubyClass superClass = findImplementerIfNecessary(self.getMetaClass(), klazz).getSuperClass(); DynamicMethod method = superClass != null ? superClass.searchMethod(name) : UndefinedMethod.INSTANCE; if (method.isUndefined()) { return callMethodMissing(context, self, method.getVisibility(), name, CallType.SUPER, block); } return method.call(context, self, superClass, name, block);
Clone fragments detected by clone detection tool
File path: /jruby-1.4.0/src/org/jruby/javasupport/util/RuntimeHelpers.java File path: /jruby-1.4.0/src/org/jruby/javasupport/util/RuntimeHelpers.java
Method name: IRubyObject invokeSuper(ThreadContext, IRubyObject, IRubyObject, IRubyObject, Block) Method name: IRubyObject invokeSuper(ThreadContext, IRubyObject, Block)
Number of AST nodes: 8 Number of AST nodes: 8
1
checkSuperDisabledOrOutOfMethod(context);
1
checkSuperDisabledOrOutOfMethod(context);
2
        RubyModule klazz = context.getFrameKlazz();
2
        RubyModule klazz = context.getFrameKlazz();
3
        String name = context.getFrameName();
3
        String name = context.getFrameName();
4
        RubyClass superClass = findImplementerIfNecessary(self.getMetaClass(), klazz).getSuperClass();
4
        RubyClass superClass = findImplementerIfNecessary(self.getMetaClass(), klazz).getSuperClass();
5
        DynamicMethod method = superClass != null ? superClass.searchMethod(name) : UndefinedMethod.INSTANCE;
5
        DynamicMethod method = superClass != null ? superClass.searchMethod(name) : UndefinedMethod.INSTANCE;
6
        if (method.isUndefined()) {
6
        if (method.isUndefined()) {
7
            return callMethodMissing(context, self, method.getVisibility(), name, CallType.SUPER, arg0, arg1, block);
7
            return callMethodMissing(context, self, method.getVisibility(), name, CallType.SUPER, block);
8
        }
8
        }
9
        return method.call(context, self, superClass, name, arg0, arg1, block);
9
        return method.call(context, self, superClass, name, block);
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 comparisons20
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements8
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)158959.9
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    checkSuperDisabledOrOutOfMethod(context);
    1
    checkSuperDisabledOrOutOfMethod(context);
    2
    RubyModule klazz = context.getFrameKlazz();
    2
    RubyModule klazz = context.getFrameKlazz();
    3
    String name = context.getFrameName();
    3
    String name = context.getFrameName();
    4
    RubyClass superClass = findImplementerIfNecessary(self.getMetaClass(), klazz).getSuperClass();
    4
    RubyClass superClass = findImplementerIfNecessary(self.getMetaClass(), klazz).getSuperClass();
    5
    DynamicMethod method = superClass != null ? superClass.searchMethod(name) : UndefinedMethod.INSTANCE;
    5
    DynamicMethod method = superClass != null ? superClass.searchMethod(name) : UndefinedMethod.INSTANCE;
    6
    if (method.isUndefined())
    6
    if (method.isUndefined())
    7
    return callMethodMissing(context, self, method.getVisibility(), name, CallType.SUPER, arg0, arg1, block);
    7
    return callMethodMissing(context, self, method.getVisibility(), name, CallType.SUPER, arg0, arg1, block);
    7
    return callMethodMissing(context, self, method.getVisibility(), name, CallType.SUPER, block);
    Differences
    Expression1Expression2Difference
    callMethodMissing(context,self,method.getVisibility(),name,CallType.SUPER,arg0,arg1,block)callMethodMissing(context,self,method.getVisibility(),name,CallType.SUPER,block)ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression callMethodMissing(context,self,method.getVisibility(),name,CallType.SUPER,arg0,arg1,block) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression callMethodMissing(context,self,method.getVisibility(),name,CallType.SUPER,block) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7
    return callMethodMissing(context, self, method.getVisibility(), name, CallType.SUPER, block);
    8
    return method.call(context, self, superClass, name, arg0, arg1, block);
    8
    return method.call(context, self, superClass, name, arg0, arg1, block);
    8
    return method.call(context, self, superClass, name, block);
    Differences
    Expression1Expression2Difference
    method.call(context,self,superClass,name,arg0,arg1,block)method.call(context,self,superClass,name,block)ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression method.call(context,self,superClass,name,arg0,arg1,block) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression method.call(context,self,superClass,name,block) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8
    return method.call(context, self, superClass, name, block);
    Precondition Violations (4)
    Row Violation
    1Expression callMethodMissing(context,self,method.getVisibility(),name,CallType.SUPER,arg0,arg1,block) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression callMethodMissing(context,self,method.getVisibility(),name,CallType.SUPER,block) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression method.call(context,self,superClass,name,arg0,arg1,block) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression method.call(context,self,superClass,name,block) cannot be parameterized, because it has dependencies to/from statements that will be extracted