IRubyObject[] args; if (arg0 instanceof RubyArray) { args = ((RubyArray)arg0).toJavaArray(); } else { args = new IRubyObject[] {arg0}; } return yieldSpecificInternal(context, args, binding, type);
IRubyObject[] parameters; if (value instanceof RubyArray) {// && args.getMaxArgumentsCount() != 1) { parameters = ((RubyArray) value).toJavaArray(); } else { parameters = new IRubyObject[] { value }; } return parameters;
Clone fragments detected by clone detection tool
File path: /jruby-1.4.0/src/org/jruby/runtime/CompiledBlock19.java File path: /jruby-1.4.0/src/org/jruby/runtime/CompiledBlock19.java
Method name: IRubyObject yieldSpecific(ThreadContext, IRubyObject, Binding, Block.Type) Method name: IRubyObject[] setupBlockArgs(IRubyObject)
Number of AST nodes: 5 Number of AST nodes: 5
1
IRubyObject[] args;
1
IRubyObject[] parameters;
2
        if (arg0 instanceof RubyArray) {
2
        if (value instanceof RubyArray) {// && args.getMaxArgumentsCount() != 1) {
3
            args = ((RubyArray)arg0).toJavaArray();
3
            parameters = ((RubyArray) value).toJavaArray();
4
        } else {
4
        } else {
5
            args = new IRubyObject[] {arg0};
5
            parameters = new IRubyObject[] { value };
6
        }
6
        }
7
        return yieldSpecificInternal(context, args, binding, type);
7
        return parameters;
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.1
Clones locationClones are declared in the same class
Number of node comparisons13
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements4
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)1.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    IRubyObject[] args;
    1
    IRubyObject[] args;
    1
    IRubyObject[] parameters;
    Differences
    Expression1Expression2Difference
    argsparametersVARIABLE_NAME_MISMATCH
    1
    IRubyObject[] parameters;
    2
    if (arg0 instanceof RubyArray)
    2
    if (arg0 instanceof RubyArray)
    2
    if (value instanceof RubyArray)
    Differences
    Expression1Expression2Difference
    arg0valueVARIABLE_NAME_MISMATCH
    2
    if (value instanceof RubyArray)
    3
    args = ((RubyArray)arg0).toJavaArray();
    3
    args = ((RubyArray)arg0).toJavaArray();
    3
    parameters = ((RubyArray)value).toJavaArray();
    Differences
    Expression1Expression2Difference
    argsparametersVARIABLE_NAME_MISMATCH
    arg0valueVARIABLE_NAME_MISMATCH
    3
    parameters = ((RubyArray)value).toJavaArray();
    else
    else
    4
    args = new IRubyObject[] {arg0};
    4
    args = new IRubyObject[] {arg0};
    4
    parameters = new IRubyObject[] {value};
    Differences
    Expression1Expression2Difference
    argsparametersVARIABLE_NAME_MISMATCH
    arg0valueVARIABLE_NAME_MISMATCH
    4
    parameters = new IRubyObject[] {value};
                                              
    5
    return parameters;
    5
    return yieldSpecificInternal(context, args, binding, type);
                                                                                                                          
    Precondition Violations (0)
    Row Violation