Ruby runtime = context.getRuntime(); if (this instanceof RubyFixnum && to instanceof RubyFixnum && step instanceof RubyFixnum) { fixnumStep(context, runtime, ((RubyFixnum)this).getLongValue(), ((RubyFixnum)to).getLongValue(), ((RubyFixnum)step).getLongValue(), block); } else if (this instanceof RubyFloat || to instanceof RubyFloat || step instanceof RubyFloat) { floatStep19(context, runtime, this, to, step, false, block); } else { duckStep(context, runtime, this, to, step, block); } return this;
Ruby runtime = context.getRuntime(); if (this instanceof RubyFixnum && to instanceof RubyFixnum && step instanceof RubyFixnum) { fixnumStep(context, runtime, ((RubyFixnum)this).getLongValue(), ((RubyFixnum)to).getLongValue(), ((RubyFixnum)step).getLongValue(), block); } else if (this instanceof RubyFloat || to instanceof RubyFloat || step instanceof RubyFloat) { floatStep(context, runtime, this, to, step, block); } else { duckStep(context, runtime, this, to, step, block); } return this;
Clone fragments detected by clone detection tool
File path: /jruby-1.4.0/src/org/jruby/RubyNumeric.java File path: /jruby-1.4.0/src/org/jruby/RubyNumeric.java
Method name: IRubyObject stepCommon19(ThreadContext, IRubyObject, IRubyObject, Block) Method name: IRubyObject step(ThreadContext, IRubyObject, IRubyObject, Block)
Number of AST nodes: 7 Number of AST nodes: 7
1
Ruby runtime = context.getRuntime();
1
Ruby runtime = context.getRuntime();
2
        if (this instanceof RubyFixnum && to instanceof RubyFixnum && step instanceof RubyFixnum) {
2
        if (this instanceof RubyFixnum && to instanceof RubyFixnum && step instanceof RubyFixnum) {
3
            fixnumStep(context, runtime, ((RubyFixnum)this).getLongValue(),
3
            fixnumStep(context, runtime, ((RubyFixnum)this).getLongValue(),
4
                                         ((RubyFixnum)to).getLongValue(),
4
                                         ((RubyFixnum)to).getLongValue(),
5
                                         ((RubyFixnum)step).getLongValue(),
5
                                         ((RubyFixnum)step).getLongValue(),
6
                                          block);
6
                                          block);
7
        } else if (this instanceof RubyFloat || to instanceof RubyFloat || step instanceof RubyFloat) {
7
        } else if (this instanceof RubyFloat || to instanceof RubyFloat || step instanceof RubyFloat) {
8
            floatStep19(context, runtime, this, to, step, false, block);
8
            floatStep(context, runtime, this, to, step, block);
9
        } else {
9
        } else {
10
            duckStep(context, runtime, this, to, step, block);
10
            duckStep(context, runtime, this, to, step, block);
11
        }
11
        }
12
        return this;
12
        return this;
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.7
Clones locationClones are declared in the same class
Number of node comparisons24
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements7
    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.6
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    Ruby runtime = context.getRuntime();
    1
    Ruby runtime = context.getRuntime();
    2
    if (this instanceof RubyFixnum && to instanceof RubyFixnum && step instanceof RubyFixnum)
    2
    if (this instanceof RubyFixnum && to instanceof RubyFixnum && step instanceof RubyFixnum)
    3
    fixnumStep(context, runtime, ((RubyFixnum)this).getLongValue(), ((RubyFixnum)to).getLongValue(), ((RubyFixnum)step).getLongValue(), block);
    3
    fixnumStep(context, runtime, ((RubyFixnum)this).getLongValue(), ((RubyFixnum)to).getLongValue(), ((RubyFixnum)step).getLongValue(), block);
    4
    else if (this instanceof RubyFloat || to instanceof RubyFloat || step instanceof RubyFloat)
    4
    else if (this instanceof RubyFloat || to instanceof RubyFloat || step instanceof RubyFloat)
    5
    floatStep19(context, runtime, this, to, step, false, block);
    5
    floatStep19(context, runtime, this, to, step, false, block);
    5
    floatStep(context, runtime, this, to, step, block);
    Differences
    Expression1Expression2Difference
    floatStep19floatStepMETHOD_INVOCATION_NAME_MISMATCH
    floatStep19(context,runtime,this,to,step,false,block)floatStep(context,runtime,this,to,step,block)ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression floatStep19(context,runtime,this,to,step,false,block) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression floatStep(context,runtime,this,to,step,block) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression floatStep19(context,runtime,this,to,step,false,block) is a void method call, and thus it cannot be parameterized
    Expression floatStep(context,runtime,this,to,step,block) is a void method call, and thus it cannot be parameterized
    Expression floatStep19(context,runtime,this,to,step,false,block) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression floatStep(context,runtime,this,to,step,block) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression floatStep19(context,runtime,this,to,step,false,block) is a void method call, and thus it cannot be parameterized
    Expression floatStep(context,runtime,this,to,step,block) is a void method call, and thus it cannot be parameterized
    5
    floatStep(context, runtime, this, to, step, block);
    else
    else
    6
    duckStep(context, runtime, this, to, step, block);
    6
    duckStep(context, runtime, this, to, step, block);
    7
    return this;
    7
    return this;
    Precondition Violations (8)
    Row Violation
    1Expression floatStep19(context,runtime,this,to,step,false,block) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression floatStep(context,runtime,this,to,step,block) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression floatStep19(context,runtime,this,to,step,false,block) is a void method call, and thus it cannot be parameterized
    4Expression floatStep(context,runtime,this,to,step,block) is a void method call, and thus it cannot be parameterized
    5Expression floatStep19(context,runtime,this,to,step,false,block) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression floatStep(context,runtime,this,to,step,block) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression floatStep19(context,runtime,this,to,step,false,block) is a void method call, and thus it cannot be parameterized
    8Expression floatStep(context,runtime,this,to,step,block) is a void method call, and thus it cannot be parameterized