Ruby runtime = context.getRuntime(); if (value.realSize == 0) return runtime.getNil(); return singleByteStrip(runtime, ASCII, value.bytes, value.begin, value.begin + value.realSize);
Ruby runtime = context.getRuntime(); if (value.realSize == 0) return runtime.getNil(); return chompBangCommon(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 strip_bang(ThreadContext) Method name: IRubyObject chomp_bang(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 singleByteStrip(runtime, ASCII, value.bytes, value.begin, value.begin + value.realSize);
3
        return chompBangCommon(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)1.8
    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 singleByteStrip(runtime, ASCII, value.bytes, value.begin, value.begin + value.realSize);
    4
    return singleByteStrip(runtime, ASCII, value.bytes, value.begin, value.begin + value.realSize);
    4
    return chompBangCommon(runtime, arg0);
    Differences
    Expression1Expression2Difference
    singleByteStripchompBangCommonMETHOD_INVOCATION_NAME_MISMATCH
    singleByteStrip(runtime,ASCII,value.bytes,value.begin,value.begin + value.realSize)chompBangCommon(runtime,arg0)ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression singleByteStrip(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 singleByteStrip
    Expression chompBangCommon(runtime,arg0) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    • Inline private method chompBangCommon
    Expression singleByteStrip(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 singleByteStrip
    Expression chompBangCommon(runtime,arg0) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    • Inline private method chompBangCommon
    4
    return chompBangCommon(runtime, arg0);
    Precondition Violations (4)
    Row Violation
    1Expression singleByteStrip(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 chompBangCommon(runtime,arg0) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression singleByteStrip(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 chompBangCommon(runtime,arg0) cannot be parameterized, because it has dependencies to/from statements that will be extracted