switch(ival = bytes[i++]) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': chars[offset++] = (char)ival; lastValidOffset = offset; break; // switch default: state = SERR_NOT_STRICT; break states; }
if ( i < buflen) { switch(ival = bytes[i++]) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': chars[offset++] = (char)ival; lastValidOffset = offset; break; // switch default: state = SCOMPLETE; break states; } // switch }
Clone fragments detected by clone detection tool
File path: /jruby-1.4.0/src/org/jruby/util/Convert.java File path: /jruby-1.4.0/src/org/jruby/util/Convert.java
Method name: double byteArrayToDouble(byte[], int, int, boolean) Method name: double byteArrayToDouble(byte[], int, int, boolean)
Number of AST nodes: 17 Number of AST nodes: 18
1
if ( i < buflen) {
1
switch(ival = bytes[i++]) {
2
                    switch(ival = bytes[i++]) {
2
                    case '0': case '1': case '2': case '3': case '4':
3
                    case '0': case '1': case '2': case '3': case '4':
3
                    case '5': case '6': case '7': case '8': case '9':
4
                    case '5': case '6': case '7': case '8': case '9':
4
                        chars[offset++] = (char)ival;
5
                        chars[offset++] = (char)ival;
5
                        lastValidOffset = offset;
6
                        lastValidOffset = offset;
6
                        break; // switch
7
                        break; // switch
7
                    default:
8
                    default:
8
                        state = SERR_NOT_STRICT;
9
                        state = SCOMPLETE;
9
                        break states;
10
                        break states;
10
                    }
11
                    } // switch
12
                }
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.7
Clones locationClones are in the same method
Number of node comparisons148
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements17
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)12.5
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    662
    switch (ival = bytes[i++])
    521
    switch (ival = bytes[i++])
    663
    case '0':
    522
    case '0':
    664
    case '1':
    523
    case '1':
    665
    case '2':
    524
    case '2':
    666
    case '3':
    525
    case '3':
    667
    case '4':
    526
    case '4':
    668
    case '5':
    527
    case '5':
    669
    case '6':
    528
    case '6':
    670
    case '7':
    529
    case '7':
    671
    case '8':
    530
    case '8':
    672
    case '9':
    531
    case '9':
    673
    chars[offset++] = (char)ival;
    532
    chars[offset++] = (char)ival;
    674
    lastValidOffset = offset;
    533
    lastValidOffset = offset;
    675
    break;
    534
    break;
    676
    default:
    535
    default:
    677
    state = SERR_NOT_STRICT;
    677
    state = SERR_NOT_STRICT;
    536
    state = SCOMPLETE;
    Differences
    Expression1Expression2Difference
    SERR_NOT_STRICTSCOMPLETEVARIABLE_NAME_MISMATCH
    536
    state = SCOMPLETE;
    678
    break states;
    537
    break states;
    Precondition Violations (1)
    Row Violation
    1Clone fragment #1 returns variables i, ival, offset, chars, lastValidOffset , while Clone fragment #2 returns variables i, ival, offset, chars, lastValidOffset