preBacktraceOnly(context, name); try { RubyClass cls = (RubyClass)self; IRubyObject obj = cls.allocate(); cls.baseCallSites[CS_IDX_INITIALIZE].call(context, self, obj, arg0, arg1, arg2, 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, 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, IRubyObject, IRubyObject, Block) Method name: IRubyObject call(ThreadContext, IRubyObject, RubyModule, String, 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, arg1, arg2, block);
5
                cls.baseCallSites[CS_IDX_INITIALIZE].call(context, self, obj, 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.5
    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, arg1, arg2, block);
    5
    cls.baseCallSites[CS_IDX_INITIALIZE].call(context, self, obj, arg0, arg1, arg2, block);
    5
    cls.baseCallSites[CS_IDX_INITIALIZE].call(context, self, obj, block);
    Differences
    Expression1Expression2Difference
    cls.baseCallSites[CS_IDX_INITIALIZE].call(context,self,obj,arg0,arg1,arg2,block)cls.baseCallSites[CS_IDX_INITIALIZE].call(context,self,obj,block)ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression cls.baseCallSites[CS_IDX_INITIALIZE].call(context,self,obj,arg0,arg1,arg2,block) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression cls.baseCallSites[CS_IDX_INITIALIZE].call(context,self,obj,block) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5
    cls.baseCallSites[CS_IDX_INITIALIZE].call(context, self, obj, block);
    6
    return obj;
    6
    return obj;
    Precondition Violations (2)
    Row Violation
    1Expression cls.baseCallSites[CS_IDX_INITIALIZE].call(context,self,obj,arg0,arg1,arg2,block) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression cls.baseCallSites[CS_IDX_INITIALIZE].call(context,self,obj,block) cannot be parameterized, because it has dependencies to/from statements that will be extracted