RubyRange range = new RubyRange(runtime, runtime.getRange()); range.init(context, begin, end, true); return range;
RubyFileStat stat = new RubyFileStat(runtime, runtime.getFileStat()); stat.setup(filename, lstat); return stat;
Clone fragments detected by clone detection tool
File path: /jruby-1.4.0/src/org/jruby/RubyRange.java File path: /jruby-1.4.0/src/org/jruby/RubyFileStat.java
Method name: RubyRange newExclusiveRange(Ruby, ThreadContext, IRubyObject, IRubyObject) Method name: RubyFileStat newFileStat(Ruby, String, boolean)
Number of AST nodes: 3 Number of AST nodes: 3
1
RubyRange range = new RubyRange(runtime, runtime.getRange());
1
RubyFileStat stat = new RubyFileStat(runtime, runtime.getFileStat());
2
        range.init(context, begin, end, true
2
        
3
);
3
        stat.setup(filename, lstat);
4
        
4
        return range;
5
        return stat;
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.0
Clones locationClones are in different classes having the same super class
Number of node comparisons5
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements3
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    RubyRange range = new RubyRange(runtime, runtime.getRange());
    1
    RubyRange range = new RubyRange(runtime, runtime.getRange());
    1
    RubyFileStat stat = new RubyFileStat(runtime, runtime.getFileStat());
    Differences
    Expression1Expression2Difference
    org.jruby.RubyRangeorg.jruby.RubyFileStatSUBCLASS_TYPE_MISMATCH
    rangestatVARIABLE_NAME_MISMATCH
    org.jruby.RubyRangeorg.jruby.RubyFileStatSUBCLASS_TYPE_MISMATCH
    org.jruby.RubyRangeorg.jruby.RubyFileStatSUBCLASS_TYPE_MISMATCH
    getRangegetFileStatMETHOD_INVOCATION_NAME_MISMATCH
    1
    RubyFileStat stat = new RubyFileStat(runtime, runtime.getFileStat());
    2
    range.init(context, begin, end, true);
    2
    range.init(context, begin, end, true);
    2
    stat.setup(filename, lstat);
    Differences
    Expression1Expression2Difference
    initsetupMETHOD_INVOCATION_NAME_MISMATCH
    rangestatVARIABLE_NAME_MISMATCH
    org.jruby.RubyRangeorg.jruby.RubyFileStatSUBCLASS_TYPE_MISMATCH
    range.init(context,begin,end,true)stat.setup(filename,lstat)ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression range.init(context,begin,end,true) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    • Inline private method init
    Expression stat.setup(filename,lstat) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    • Inline private method setup
    Expression range.init(context,begin,end,true) is a void method call, and thus it cannot be parameterized
    Expression stat.setup(filename,lstat) is a void method call, and thus it cannot be parameterized
    Expression range.init(context,begin,end,true) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    • Inline private method init
    Expression stat.setup(filename,lstat) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    • Inline private method setup
    Expression range.init(context,begin,end,true) is a void method call, and thus it cannot be parameterized
    Expression stat.setup(filename,lstat) is a void method call, and thus it cannot be parameterized
    2
    stat.setup(filename, lstat);
    3
    return range;
    3
    return range;
    3
    return stat;
    Differences
    Expression1Expression2Difference
    rangestatVARIABLE_NAME_MISMATCH
    org.jruby.RubyRangeorg.jruby.RubyFileStatSUBCLASS_TYPE_MISMATCH
    3
    return stat;
    Precondition Violations (8)
    Row Violation
    1Expression range.init(context,begin,end,true) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression stat.setup(filename,lstat) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression range.init(context,begin,end,true) is a void method call, and thus it cannot be parameterized
    4Expression stat.setup(filename,lstat) is a void method call, and thus it cannot be parameterized
    5Expression range.init(context,begin,end,true) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression stat.setup(filename,lstat) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression range.init(context,begin,end,true) is a void method call, and thus it cannot be parameterized
    8Expression stat.setup(filename,lstat) is a void method call, and thus it cannot be parameterized