for ( ; 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 case '.': state = SDECDIGIT_STRICT; break states; case 'e': case 'E': state = SEXP_STRICT; break states; case '_': if (i >= buflen || bytes[i] < '0' || bytes[i] > '9') { state = SERR_NOT_STRICT; break states; } break; //switch default: // only whitespace allowed after value for strict for ( --i; i < buflen && isWhitespace(bytes[i]); i++) ; state = i < buflen ? SERR_NOT_STRICT : SCOMPLETE; break states; } // switch }
for ( ; 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 case 'e': case 'E': state = SEXP; break states; case '_': 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: 32 Number of AST nodes: 24
1
for ( ; i < buflen ; ) {
1
for ( ; i < buflen ; ) {
2
                    switch(ival = bytes[i++]) {
2
                    switch(ival = bytes[i++]) {
3
                    case '0': case '1': case '2': case '3': case '4':
3
                    case '0': case '1': case '2': case '3': case '4':
4
                    case '5': case '6': case '7': case '8': case '9':
4
                    case '5': case '6': case '7': case '8': case '9':
5
                        chars[offset++] = (char)ival;
5
                        chars[offset++] = (char)ival;
6
                        lastValidOffset = offset;
6
                        lastValidOffset = offset;
7
                        break; // switch
7
                        break; // switch
8
                    case '.':
9
                        state = SDECDIGIT_STRICT;
10
                        break states;
11
                    case 'e':
8
                    case 'e':
12
                    case 'E':
9
                    case 'E':
13
                        state = SEXP_STRICT;
10
                        state = SEXP;
14
                        break states;
11
                        break states;
15
                    case '_':
12
                    case '_':
16
                        if (i >= buflen || bytes[i] < '0' || bytes[i] > '9') {
17
                            state = SERR_NOT_STRICT;
18
                            break states;
19
                        }
20
                        break; //switch
13
                        break; // switch
21
                    default:
14
                    default:
22
                        // only whitespace allowed after value for strict
15
                        
23
                        for ( --i; i < buflen && isWhitespace(bytes[i]);  i++) ;
24
                        state = i < buflen ? SERR_NOT_STRICT : SCOMPLETE; 
16
state = SCOMPLETE;
25
                        break states;
17
                        break states;
26
                    } // switch
18
                    } // switch
27
                }
19
                }
Summary
Number of common nesting structure subtrees0
Number of refactorable cases0
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.1
Clones locationClones are in the same method
Number of node comparisons2