int length = values == null ? 0 : values.length; switch (length) { case 0: assign(runtime, context, self, block); break; case 1: assign(runtime, context, self, values[0], block); break; default: assign(runtime, context, self, values[0], values[1], block); break; }
int length = values == null ? 0 : values.length; switch (length) { case 0: assign(runtime, context, self, block); break; case 1: assign(runtime, context, self, values[0], block); break; default: assign(runtime, context, self, runtime.newArray(values), block); }
Clone fragments detected by clone detection tool
File path: /jruby-1.4.0/src/org/jruby/runtime/assigner/Pre2Rest0Post0Assigner.java File path: /jruby-1.4.0/src/org/jruby/runtime/assigner/Pre1ExpandedRest0Post0Assigner.java
Method name: void assign(Ruby, ThreadContext, IRubyObject, IRubyObject[], Block) Method name: void assign(Ruby, ThreadContext, IRubyObject, IRubyObject[], Block)
Number of AST nodes: 11 Number of AST nodes: 10
1
int length = values == null ? 0 : values.length;
1
int length = values == null ? 0 : values.length;
2
        switch (length) {
2
        switch (length) {
3
            case 0:
3
            case 0:
4
                assign(runtime, context, self, block);
4
                assign(runtime, context, self, block);
5
                break;
5
                break;
6
            case 1:
6
            case 1:
7
                assign(runtime, context, self, values[0], block);
7
                assign(runtime, context, self, values[0], block);
8
                break;
8
                break;
9
            default:
9
            default:
10
                assign(runtime, context, self, values[0], values[1], block);
10
                assign(runtime, context, self, runtime.newArray(values), block);
11
                break;
12
        }
11
        }
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 having the same super class
Number of node comparisons47
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements10
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)2.3
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    1
    int length = values == null ? 0 : values.length;
    1
    int length = values == null ? 0 : values.length;
    2
    switch (length)
    2
    switch (length)
    3
    case 0:
    3
    case 0:
    4
    assign(runtime, context, self, block);
    4
    assign(runtime, context, self, block);
    5
    break;
    5
    break;
    6
    case 1:
    6
    case 1:
    7
    assign(runtime, context, self, values[0], block);
    7
    assign(runtime, context, self, values[0], block);
    8
    break;
    8
    break;
    9
    default:
    9
    default:
    10
    assign(runtime, context, self, values[0], values[1], block);
    10
    assign(runtime, context, self, values[0], values[1], block);
    10
    assign(runtime, context, self, runtime.newArray(values), block);
    Differences
    Expression1Expression2Difference
    assign(runtime,context,self,values[0],values[1],block)assign(runtime,context,self,runtime.newArray(values),block)ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression assign(runtime,context,self,values[0],values[1],block) is a void method call, and thus it cannot be parameterized
    Expression assign(runtime,context,self,runtime.newArray(values),block) is a void method call, and thus it cannot be parameterized
    10
    assign(runtime, context, self, runtime.newArray(values), block);
    11
    break;
    11
    break;
    Preondition Violations
    Unmatched break;
                        
    Precondition Violations (3)
    Row Violation
    1Expression assign(runtime,context,self,values[0],values[1],block) is a void method call, and thus it cannot be parameterized
    2Expression assign(runtime,context,self,runtime.newArray(values),block) is a void method call, and thus it cannot be parameterized
    3Unmatched break;