while (nv < 0 || 0 < --nv) { for (int i=0; i < len; i++) { block.yield(context, result.eltInternal(i)); } }
for (int i = 0; i < realLength; i++) { block.yield(context, values[begin + i]); }
Clone fragments detected by clone detection tool
File path: /jruby-1.4.0/src/org/jruby/RubyEnumerable.java File path: /jruby-1.4.0/src/org/jruby/RubyArray.java
Method name: IRubyObject cycleCommon(ThreadContext, IRubyObject, long, Block) Method name: IRubyObject combination(ThreadContext, IRubyObject, Block)
Number of AST nodes: 3 Number of AST nodes: 2
1
while (nv < 0 || 0 < --nv) {
2
            for (int i=0; i < len; i++) {
1
for (int i = 0; i < realLength; i++) {
3
                block.yield(context, result.eltInternal(i));
2
                block.yield(context, values[begin + i]);
4
            }
3
            }
5
        }
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 in different classes
Number of node comparisons6
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    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.8
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    8
    for (int i = 0; i < len; i++)
    8
    for (int i = 0; i < len; i++)
    8
    for (int i = 0; i < realLength; i++)
    Differences
    Expression1Expression2Difference
    lenrealLengthVARIABLE_NAME_MISMATCH
    8
    for (int i = 0; i < realLength; i++)
    9
    block.yield(context, result.eltInternal(i));
    9
    block.yield(context, result.eltInternal(i));
    9
    block.yield(context, values[begin + i]);
    Differences
    Expression1Expression2Difference
    result.eltInternal(i)values[begin + i]TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression result.eltInternal(i) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression values[begin + i] cannot be parameterized, because it has dependencies to/from statements that will be extracted
    9
    block.yield(context, values[begin + i]);
    Precondition Violations (2)
    Row Violation
    1Expression result.eltInternal(i) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression values[begin + i] cannot be parameterized, because it has dependencies to/from statements that will be extracted