if (!(value instanceof RubyArray)) { value = ArgsUtil.convertToRubyArray(runtime, value, masgnHasHead); } return (RubyArray) value;
if (!(obj instanceof RubyArray)) { throw obj.getRuntime().newArgumentError("Array expected"); } return (RubyArray) obj;
Clone fragments detected by clone detection tool
File path: /jruby-1.4.0/src/org/jruby/javasupport/util/RuntimeHelpers.java File path: /jruby-1.4.0/src/org/jruby/ext/ffi/AbstractMemory.java
Method name: RubyArray ensureMultipleAssignableRubyArray(IRubyObject, Ruby, boolean) Method name: RubyArray checkArray(IRubyObject)
Number of AST nodes: 3 Number of AST nodes: 3
1
if (!(value instanceof RubyArray)) {
1
if (!(obj instanceof RubyArray)) {
2
            value = ArgsUtil.convertToRubyArray(runtime, value, masgnHasHead);
2
            throw obj.getRuntime().newArgumentError("Array expected");
3
        }
3
        }
4
        return (RubyArray) value;
4
        return (RubyArray) obj;
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.1
Clones locationClones are in different classes
Number of node comparisons5
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)0.5
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (!(value instanceof RubyArray))
    1
    if (!(value instanceof RubyArray))
    1
    if (!(obj instanceof RubyArray))
    Differences
    Expression1Expression2Difference
    valueobjVARIABLE_NAME_MISMATCH
    1
    if (!(obj instanceof RubyArray))
                                                                                                                              
    2
    throw obj.getRuntime().newArgumentError("Array expected");
    Preondition Violations
    Unmatched throw obj.getRuntime().newArgumentError("Array expected");
    2
    throw obj.getRuntime().newArgumentError("Array expected");
    2
    value = ArgsUtil.convertToRubyArray(runtime, value, masgnHasHead);
    2
    value = ArgsUtil.convertToRubyArray(runtime, value, masgnHasHead);
    Preondition Violations
    Unmatched statement value=ArgsUtil.convertToRubyArray(runtime,value,masgnHasHead); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                                                                      
    3
    return (RubyArray)value;
    3
    return (RubyArray)value;
    3
    return (RubyArray)obj;
    Differences
    Expression1Expression2Difference
    valueobjVARIABLE_NAME_MISMATCH
    3
    return (RubyArray)obj;
    Precondition Violations (2)
    Row Violation
    1Unmatched throw obj.getRuntime().newArgumentError("Array expected");
    2Unmatched statement value=ArgsUtil.convertToRubyArray(runtime,value,masgnHasHead); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted