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_STRICT; break states; case '_': if (i >= buflen || bytes[i] < '0' || bytes[i] > '9') { state = SERR_NOT_STRICT; break states; } break; //switch default: for ( --i; i < buflen && isWhitespace(bytes[i]); i++) ; state = i < buflen ? SERR_NOT_STRICT : SCOMPLETE; break states; } // switch }
if (i < buflen) { switch(ival = bytes[i++]) { case '0': // ignore leading zeroes break; // switch 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; break states; 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: 29 Number of AST nodes: 22
1
for ( ; i < buflen ; ) {
1
if (i < buflen) {
2
                    switch(ival = bytes[i++]) {
2
                    switch(ival = bytes[i++]) {
3
                    case '0':
3
                    case '0':
4
                        // ignore leading zeroes
5
                        break; // switch
4
 case '1': case '2': case '3': case '4':
6
                    case '1': case '2': case '3': case '4':
5
                    case '5': case '6': case '7': case '8': case '9':
7
                    case '5': case '6': case '7': case '8': case '9':
6
                        chars[offset++] = (char)ival;
8
                        chars[offset++] = (char)ival;
7
                        lastValidOffset = offset;
9
                        lastValidOffset = offset;
8
                        break; // switch
10
                        break; // switch
9
                    case 'e':
11
                    case '
10
                    case 'E':
12
.':
11
                        state = SEXP_STRICT;
13
                        state = S
12
                        break states;
13
                    case '_':
14
                        if (i >= buflen || bytes[i] < '0' || bytes[i] > '9') {
15
                            state = SERR_NOT_STRICT;
16
                            break states;
17
                        }
18
                        break; //switch
19
                    default:
20
                        for ( --i; i < buflen && isWhitespace(bytes[i]);  i++) ;
21
                        state = i < buflen ? SERR_NOT_STRICT :
14
DECDIGIT;
15
                        break states;
16
                    default:
22
 SCOMPLETE; 
17
                        state = SCOMPLETE;
23
                        break states;
18
                        break states;
24
                    } // switch
19
                    } // switch
25
                }
20
                }
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.0
Clones locationClones are in the same method
Number of node comparisons2