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, block); } return method.call(context, self, superClass, name, arg0, 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, args, block); } return method.call(context, self, superClass, name, args, 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, Block) Method name: IRubyObject invokeSuper(ThreadContext, IRubyObject, 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
        
6
        if (method.isUndefined()) {
7
        if (method.isUndefined()) {
7
            return callMethodMissing(context, self, method.getVisibility(), name, CallType.SUPER, arg0, block);
8
            return callMethodMissing(context, self, method.getVisibility(), name, CallType.SUPER, args, block);
8
        }
9
        }
9
        return method.call(context, self, superClass, name, arg0, block);
10
        return method.call(context, self, superClass, name, args, 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)4.8
    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, block);
    7
    return callMethodMissing(context, self, method.getVisibility(), name, CallType.SUPER, arg0, block);
    7
    return callMethodMissing(context, self, method.getVisibility(), name, CallType.SUPER, 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 callMethodMissing(context, self, method.getVisibility(), name, CallType.SUPER, args, block);
    8
    return method.call(context, self, superClass, name, arg0, block);
    8
    return method.call(context, self, superClass, name, arg0, block);
    8
    return method.call(context, self, superClass, 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
    8
    return method.call(context, self, superClass, 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