preBacktraceOnly(context, name); try { RubyClass cls = (RubyClass)self; IRubyObject obj = cls.allocate(); cls.baseCallSites[CS_IDX_INITIALIZE].call(context, self, obj, arg0, block); return obj; } finally { postBacktraceOnly(context); }
preBacktraceOnly(context, name); try { RubyClass cls = (RubyClass)self; IRubyObject obj = cls.allocate(); cls.baseCallSites[CS_IDX_INITIALIZE].call(context, self, obj, args, block); return obj; } finally { postBacktraceOnly(context); }
Clone fragments detected by clone detection tool
File path: /jruby-1.4.0/src/org/jruby/RubyClass.java File path: /jruby-1.4.0/src/org/jruby/RubyClass.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: 6 Number of AST nodes: 6
1
preBacktraceOnly(context, name);
1
preBacktraceOnly(context, name);
2
            try {
2
            try {
3
                RubyClass cls = (RubyClass)self;
3
                RubyClass cls = (RubyClass)self;
4
                IRubyObject obj = cls.allocate();
4
                IRubyObject obj = cls.allocate();
5
                cls.baseCallSites[CS_IDX_INITIALIZE].call(context, self, obj, arg0, block);
5
                cls.baseCallSites[CS_IDX_INITIALIZE].call(context, self, obj, args, block);
6
                return obj;
6
                return obj;
7
            } finally {
7
            } finally {
8
                postBacktraceOnly(context);
8
                postBacktraceOnly(context);
9
            }
9
            }
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.1
Clones locationClones are declared in the same class
Number of node comparisons26
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements6
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)1.6
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    preBacktraceOnly(context, name);
    1
    preBacktraceOnly(context, name);
    2
    try
    2
    try
    3
    RubyClass cls = (RubyClass)self;
    3
    RubyClass cls = (RubyClass)self;
    4
    IRubyObject obj = cls.allocate();
    4
    IRubyObject obj = cls.allocate();
    5
    cls.baseCallSites[CS_IDX_INITIALIZE].call(context, self, obj, arg0, block);
    5
    cls.baseCallSites[CS_IDX_INITIALIZE].call(context, self, obj, arg0, block);
    5
    cls.baseCallSites[CS_IDX_INITIALIZE].call(context, self, obj, 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
    5
    cls.baseCallSites[CS_IDX_INITIALIZE].call(context, self, obj, args, block);
    6
    return obj;
    6
    return obj;
    Precondition Violations (1)
    Row Violation
    1Type org.jruby.runtime.builtin.IRubyObject of variable arg0 does not match with type org.jruby.runtime.builtin.IRubyObject[] of variable args