IRubyObject proxy = oldNew.call(context, self, clazz, "new_proxy", arg0); if (!(proxy.dataGetStruct() instanceof JavaObject)) { // Need to initialize RuntimeHelpers.invoke(context, proxy, "__jcreate!", arg0); } return proxy;
IRubyObject proxy = oldNew.call(context, self, clazz, "new_proxy", args); if (!(proxy.dataGetStruct() instanceof JavaObject)) { // Need to initialize RuntimeHelpers.invoke(context, proxy, "__jcreate!", args); } return proxy;
Clone fragments detected by clone detection tool
File path: /jruby-1.4.0/src/org/jruby/java/proxies/ConcreteJavaProxy.java File path: /jruby-1.4.0/src/org/jruby/java/proxies/ConcreteJavaProxy.java
Method name: IRubyObject call(ThreadContext, IRubyObject, RubyModule, String, IRubyObject) Method name: IRubyObject call(ThreadContext, IRubyObject, RubyModule, String, IRubyObject[])
Number of AST nodes: 4 Number of AST nodes: 4
1
IRubyObject proxy = oldNew.call(context, self, clazz, "new_proxy", arg0);
1
IRubyObject proxy = oldNew.call(context, self, clazz, "new_proxy", args);
2
            if (!(proxy.dataGetStruct() instanceof JavaObject)) { // Need to initialize
2
            if (!(proxy.dataGetStruct() instanceof JavaObject)) { // Need to initialize
3
                RuntimeHelpers.invoke(context, proxy, "__jcreate!", arg0);
3
                RuntimeHelpers.invoke(context, proxy, "__jcreate!", args);
4
            }
4
            }
5
            return proxy;
5
            return proxy;
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 comparisons8
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements4
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)2.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    IRubyObject proxy = oldNew.call(context, self, clazz, "new_proxy", arg0);
    1
    IRubyObject proxy = oldNew.call(context, self, clazz, "new_proxy", arg0);
    1
    IRubyObject proxy = oldNew.call(context, self, clazz, "new_proxy", args);
    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
    1
    IRubyObject proxy = oldNew.call(context, self, clazz, "new_proxy", args);
    2
    if (!(proxy.dataGetStruct() instanceof JavaObject))
    2
    if (!(proxy.dataGetStruct() instanceof JavaObject))
    3
    RuntimeHelpers.invoke(context, proxy, "__jcreate!", arg0);
    3
    RuntimeHelpers.invoke(context, proxy, "__jcreate!", arg0);
    3
    RuntimeHelpers.invoke(context, proxy, "__jcreate!", args);
    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
    3
    RuntimeHelpers.invoke(context, proxy, "__jcreate!", args);
    4
    return proxy;
    4
    return proxy;
    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