RubyArray ary = aryDup(); ary.reject_bang(context, block); return ary;
RubyArray ary = to_a(); ary.callMethod(context, "flatten!", RubyFixnum.one(context.getRuntime())); return ary;
Clone fragments detected by clone detection tool
File path: /jruby-1.4.0/src/org/jruby/RubyArray.java File path: /jruby-1.4.0/src/org/jruby/RubyHash.java
Method name: IRubyObject rejectCommon(ThreadContext, Block) Method name: IRubyObject flatten(ThreadContext)
Number of AST nodes: 3 Number of AST nodes: 3
1
RubyArray ary = aryDup();
1
RubyArray ary = to_a(); 
2
        ary.reject_bang(context, block);
2
        ary.callMethod(context, "flatten!", RubyFixnum.one(context.getRuntime()));
3
        return ary;
3
        return ary;
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 comparisons9
  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
    RubyArray ary = aryDup();
    1
    RubyArray ary = aryDup();
    1
    RubyArray ary = to_a();
    Differences
    Expression1Expression2Difference
    aryDupto_aMETHOD_INVOCATION_NAME_MISMATCH
    1
    RubyArray ary = to_a();
    2
    ary.reject_bang(context, block);
    2
    ary.reject_bang(context, block);
    2
    ary.callMethod(context, "flatten!", RubyFixnum.one(context.getRuntime()));
    Differences
    Expression1Expression2Difference
    reject_bangcallMethodMETHOD_INVOCATION_NAME_MISMATCH
    ary.reject_bang(context,block)ary.callMethod(context,"flatten!",RubyFixnum.one(context.getRuntime()))ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression ary.reject_bang(context,block) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression ary.callMethod(context,"flatten!",RubyFixnum.one(context.getRuntime())) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression ary.reject_bang(context,block) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression ary.callMethod(context,"flatten!",RubyFixnum.one(context.getRuntime())) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2
    ary.callMethod(context, "flatten!", RubyFixnum.one(context.getRuntime()));
    3
    return ary;
    3
    return ary;
    Precondition Violations (4)
    Row Violation
    1Expression ary.reject_bang(context,block) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression ary.callMethod(context,"flatten!",RubyFixnum.one(context.getRuntime())) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression ary.reject_bang(context,block) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression ary.callMethod(context,"flatten!",RubyFixnum.one(context.getRuntime())) cannot be parameterized, because it has dependencies to/from statements that will be extracted