for (int i = 0; i < args.length; ++i) { marshallers[i].marshal(invocation, buffer, args[i]); } return functionInvoker.invoke(context.getRuntime(), function, buffer);
for (int i = 0; i < args.length; ++i) { marshallers[i].marshal(context, buffer, args[i]); } return functionInvoker.invoke(context.getRuntime(), function, buffer);
Clone fragments detected by clone detection tool
File path: /jruby-1.4.0/src/org/jruby/ext/ffi/jffi/DefaultMethod.java File path: /jruby-1.4.0/src/org/jruby/ext/ffi/jffi/DefaultMethod.java
Method name: IRubyObject call(ThreadContext, IRubyObject, RubyModule, String, IRubyObject[], Block) Method name: IRubyObject call(ThreadContext, IRubyObject, RubyModule, String, IRubyObject[], Block)
Number of AST nodes: 3 Number of AST nodes: 3
1
for (int i = 0; i < args.length; ++i) {
1
for (int i = 0; i < args.length; ++i) {
2
                    marshallers[i].marshal(invocation, buffer, args[i]);
2
                marshallers[i].marshal(context, buffer, args[i]);
3
                }
3
            
4
    
4
}
5
            return functionInvoker.invoke(context.getRuntime(), function, buffer);
5
            return functionInvoker.invoke(context.getRuntime(), function, buffer);
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 in the same method
Number of node comparisons5
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements3
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)0.7
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    6
    for (int i = 0; i < args.length; ++i)
    9
    for (int i = 0; i < args.length; ++i)
    7
    marshallers[i].marshal(invocation, buffer, args[i]);
    7
    marshallers[i].marshal(invocation, buffer, args[i]);
    10
    marshallers[i].marshal(context, buffer, args[i]);
    Differences
    Expression1Expression2Difference
    invocationcontextVARIABLE_NAME_MISMATCH
    org.jruby.ext.ffi.jffi.Invocationorg.jruby.runtime.ThreadContextVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jruby.ext.ffi.jffi.Invocation of variable invocation does not match with type org.jruby.runtime.ThreadContext of variable context
    • Make classes org.jruby.ext.ffi.jffi.Invocation and org.jruby.runtime.ThreadContext extend a common superclass
    10
    marshallers[i].marshal(context, buffer, args[i]);
    8
    return functionInvoker.invoke(context.getRuntime(), function, buffer);
    11
    return functionInvoker.invoke(context.getRuntime(), function, buffer);
    Precondition Violations (1)
    Row Violation
    1Type org.jruby.ext.ffi.jffi.Invocation of variable invocation does not match with type org.jruby.runtime.ThreadContext of variable context