Ruby runtime = context.getRuntime(); if (value.realSize == 0) return runtime.getNil(); return singleByteLStrip(runtime, ASCII, value.bytes, value.begin, value.begin + value.realSize);
Ruby runtime = context.getRuntime(); if (value.realSize == 0) return runtime.getNil(); return chompBangCommon19(runtime, arg0);
Clone fragments detected by clone detection tool
File path: /jruby-1.4.0/src/org/jruby/RubyString.java File path: /jruby-1.4.0/src/org/jruby/RubyString.java
Method name: IRubyObject lstrip_bang(ThreadContext) Method name: IRubyObject chomp_bang19(ThreadContext, IRubyObject)
Number of AST nodes: 4 Number of AST nodes: 4
1
Ruby runtime = context.getRuntime();
1
Ruby runtime = context.getRuntime();
2
        if (value.realSize == 0) return runtime.getNil();
2
        if (value.realSize == 0) return runtime.getNil();
3
        return singleByteLStrip(runtime, ASCII, value.bytes, value.begin, value.begin + value.realSize);
3
        return chompBangCommon19(runtime, arg0);
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 comparisons6
  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)2.7
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    Ruby runtime = context.getRuntime();
    1
    Ruby runtime = context.getRuntime();
    2
    if (value.realSize == 0)
    2
    if (value.realSize == 0)
    3
    return runtime.getNil();
    3
    return runtime.getNil();
    4
    return singleByteLStrip(runtime, ASCII, value.bytes, value.begin, value.begin + value.realSize);
    4
    return singleByteLStrip(runtime, ASCII, value.bytes, value.begin, value.begin + value.realSize);
    4
    return chompBangCommon19(runtime, arg0);
    Differences
    Expression1Expression2Difference
    singleByteLStripchompBangCommon19METHOD_INVOCATION_NAME_MISMATCH
    singleByteLStrip(runtime,ASCII,value.bytes,value.begin,value.begin + value.realSize)chompBangCommon19(runtime,arg0)ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression singleByteLStrip(runtime,ASCII,value.bytes,value.begin,value.begin + value.realSize) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    • Inline private method singleByteLStrip
    Expression chompBangCommon19(runtime,arg0) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    • Inline private method chompBangCommon19
    Expression singleByteLStrip(runtime,ASCII,value.bytes,value.begin,value.begin + value.realSize) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    • Inline private method singleByteLStrip
    Expression chompBangCommon19(runtime,arg0) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    • Inline private method chompBangCommon19
    4
    return chompBangCommon19(runtime, arg0);
    Precondition Violations (4)
    Row Violation
    1Expression singleByteLStrip(runtime,ASCII,value.bytes,value.begin,value.begin + value.realSize) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression chompBangCommon19(runtime,arg0) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression singleByteLStrip(runtime,ASCII,value.bytes,value.begin,value.begin + value.realSize) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression chompBangCommon19(runtime,arg0) cannot be parameterized, because it has dependencies to/from statements that will be extracted