if (this instanceof RubyFixnum && to instanceof RubyFixnum) { fixnumDownto(context, ((RubyFixnum)this).getLongValue(), ((RubyFixnum)to).getLongValue(), block); } else { duckDownto(context, this, to, block); } return this;
if (this instanceof RubyFixnum && to instanceof RubyFixnum) { fixnumUpto(context, ((RubyFixnum)this).getLongValue(), ((RubyFixnum)to).getLongValue(), block); } else { duckUpto(context, this, to, block); } return this;
Clone fragments detected by clone detection tool
File path: /jruby-1.4.0/src/org/jruby/RubyInteger.java File path: /jruby-1.4.0/src/org/jruby/RubyInteger.java
Method name: IRubyObject downto(ThreadContext, IRubyObject, Block) Method name: IRubyObject upto(ThreadContext, IRubyObject, Block)
Number of AST nodes: 4 Number of AST nodes: 4
1
if (this instanceof RubyFixnum && to instanceof RubyFixnum) {
1
if (this instanceof RubyFixnum && to instanceof RubyFixnum) {
2
            fixnumDownto(context, ((RubyFixnum)this).getLongValue(), ((RubyFixnum)to).getLongValue(), block);
2
            fixnumUpto(context, ((RubyFixnum)this).getLongValue(), ((RubyFixnum)to).getLongValue(), block);
3
        } else {
3
        } else {
4
            duckDownto(context, this, to, block);
4
            duckUpto(context, this, to, block);
5
        }
5
        }
6
        return this;
6
        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.2
Clones locationClones are declared in the same class
Number of node comparisons10
  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)1.7
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (this instanceof RubyFixnum && to instanceof RubyFixnum)
    1
    if (this instanceof RubyFixnum && to instanceof RubyFixnum)
    2
    fixnumDownto(context, ((RubyFixnum)this).getLongValue(), ((RubyFixnum)to).getLongValue(), block);
    2
    fixnumDownto(context, ((RubyFixnum)this).getLongValue(), ((RubyFixnum)to).getLongValue(), block);
    2
    fixnumUpto(context, ((RubyFixnum)this).getLongValue(), ((RubyFixnum)to).getLongValue(), block);
    Differences
    Expression1Expression2Difference
    fixnumDowntofixnumUptoMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression fixnumDownto(context,((RubyFixnum)this).getLongValue(),((RubyFixnum)to).getLongValue(),block) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    • Inline private method fixnumDownto
    Expression fixnumUpto(context,((RubyFixnum)this).getLongValue(),((RubyFixnum)to).getLongValue(),block) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    • Inline private method fixnumUpto
    Expression fixnumDownto(context,((RubyFixnum)this).getLongValue(),((RubyFixnum)to).getLongValue(),block) is a void method call, and thus it cannot be parameterized
    Expression fixnumUpto(context,((RubyFixnum)this).getLongValue(),((RubyFixnum)to).getLongValue(),block) is a void method call, and thus it cannot be parameterized
    2
    fixnumUpto(context, ((RubyFixnum)this).getLongValue(), ((RubyFixnum)to).getLongValue(), block);
    else
    else
    3
    duckDownto(context, this, to, block);
    3
    duckDownto(context, this, to, block);
    3
    duckUpto(context, this, to, block);
    Differences
    Expression1Expression2Difference
    duckDowntoduckUptoMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression duckDownto(context,this,to,block) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    • Inline private method duckDownto
    Expression duckUpto(context,this,to,block) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    • Inline private method duckUpto
    Expression duckDownto(context,this,to,block) is a void method call, and thus it cannot be parameterized
    Expression duckUpto(context,this,to,block) is a void method call, and thus it cannot be parameterized
    3
    duckUpto(context, this, to, block);
    4
    return this;
    4
    return this;
    Precondition Violations (8)
    Row Violation
    1Expression fixnumDownto(context,((RubyFixnum)this).getLongValue(),((RubyFixnum)to).getLongValue(),block) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression fixnumUpto(context,((RubyFixnum)this).getLongValue(),((RubyFixnum)to).getLongValue(),block) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression fixnumDownto(context,((RubyFixnum)this).getLongValue(),((RubyFixnum)to).getLongValue(),block) is a void method call, and thus it cannot be parameterized
    4Expression fixnumUpto(context,((RubyFixnum)this).getLongValue(),((RubyFixnum)to).getLongValue(),block) is a void method call, and thus it cannot be parameterized
    5Expression duckDownto(context,this,to,block) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression duckUpto(context,this,to,block) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression duckDownto(context,this,to,block) is a void method call, and thus it cannot be parameterized
    8Expression duckUpto(context,this,to,block) is a void method call, and thus it cannot be parameterized