assert offset < SIZE : SIZE_ERROR; switch (offset) { case 0: return variableValueZero = value; case 1: return variableValueOne = value; case 2: return variableValueTwo = value; case 3: return variableValueThree = value; default: throw new RuntimeException(SIZE_ERROR); }
assert offset < SIZE : SIZE_ERROR; switch (offset) { case 0: return variableValueZero = value; case 1: return variableValueOne = value; case 2: return variableValueTwo = value; case 3: return variableValueThree = value; default: throw new RuntimeException(SIZE_ERROR); }
Clone fragments detected by clone detection tool
File path: /jruby-1.4.0/src/org/jruby/runtime/scope/FourVarDynamicScope.java File path: /jruby-1.4.0/src/org/jruby/runtime/scope/FourVarDynamicScope.java
Method name: IRubyObject setValueDepthZero(IRubyObject, int) Method name: IRubyObject setValue(int, IRubyObject, int)
Number of AST nodes: 12 Number of AST nodes: 12
1
assert offset < SIZE : SIZE_ERROR;
1
assert offset < SIZE : SIZE_ERROR;
2
        switch (offset) {
2
            switch (offset) {
3
        case 0:
3
            case 0:
4
            return variableValueZero = value;
4
                return variableValueZero = value;
5
        case 1:
5
            case 1:
6
            return variableValueOne = value;
6
                return variableValueOne = value;
7
        case 2:
7
            case 2:
8
            return variableValueTwo = value;
8
                return variableValueTwo = value;
9
        case 3:
9
            case 3:
10
            return variableValueThree = value;
10
                return variableValueThree = value;
11
        default:
11
            default:
12
            throw new RuntimeException(SIZE_ERROR);
12
                throw new RuntimeException(SIZE_ERROR);
13
        }
13
            }
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 comparisons62
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements12
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)1.5
    Clone typeType 1
    Mapped Statements
    ID Statement ID Statement
    1
    assert offset < SIZE : SIZE_ERROR;
    4
    assert offset < SIZE : SIZE_ERROR;
    2
    switch (offset)
    5
    switch (offset)
    3
    case 0:
    6
    case 0:
    4
    return variableValueZero = value;
    7
    return variableValueZero = value;
    5
    case 1:
    8
    case 1:
    6
    return variableValueOne = value;
    9
    return variableValueOne = value;
    7
    case 2:
    10
    case 2:
    8
    return variableValueTwo = value;
    11
    return variableValueTwo = value;
    9
    case 3:
    12
    case 3:
    10
    return variableValueThree = value;
    13
    return variableValueThree = value;
    11
    default:
    14
    default:
    12
    throw new RuntimeException(SIZE_ERROR);
    15
    throw new RuntimeException(SIZE_ERROR);
    Precondition Violations (0)
    Row Violation