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: 29 | |||
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_STRICT;↵ | |
14 | break states;↵ | 11 | break states;↵ | |
15 | case '_':↵ | 12 | case '_':↵ | |
16 | if (i >= buflen || bytes[i] < '0' || bytes[i] > '9') {↵ | 13 | if (i >= buflen || bytes[i] < '0' || bytes[i] > '9') {↵ | |
17 | state = SERR_NOT_STRICT;↵ | 14 | state = SERR_NOT_STRICT;↵ | |
18 | break states;↵ | 15 | break states;↵ | |
19 | }↵ | 16 | }↵ | |
20 | break; //switch↵ | 17 | break; //switch↵ | |
21 | default:↵ | 18 | default:↵ | |
22 | // only whitespace allowed after value for strict↵ | |||
23 | for ( --i; i < buflen && isWhitespace(bytes[i]); i++) ;↵ | 19 | for ( --i; i < buflen && isWhitespace(bytes[i]); i++) ;↵ | |
24 | state = i < buflen ? SERR_NOT_STRICT : SCOMPLETE; ↵ | 20 | state = i < buflen ? SERR_NOT_STRICT : SCOMPLETE; ↵ | |
25 | break states;↵ | 21 | break states;↵ | |
26 | } // switch↵ | 22 | } // switch↵ | |
27 | } | 23 |
| |
See real code fragment | See real code fragment |
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 1 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 4.3 |
Clones location | Clones are in the same method |
Number of node comparisons | 302 |
Number of mapped statements | 29 |
Number of unmapped statements in the first code fragment | 3 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 226.2 |
Clone type | Type 3 |
ID | Statement | ID | Statement | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
625 | for (; i < buflen; ) | 681 | for (; i < buflen; ) | |||||||||||
626 | switch (ival = bytes[i++]) | 682 | switch (ival = bytes[i++]) | |||||||||||
627 | case '0': | 683 | case '0': | |||||||||||
628 | case '1': | 684 | case '1': | |||||||||||
629 | case '2': | 685 | case '2': | |||||||||||
630 | case '3': | 686 | case '3': | |||||||||||
631 | case '4': | 687 | case '4': | |||||||||||
632 | case '5': | 688 | case '5': | |||||||||||
633 | case '6': | 689 | case '6': | |||||||||||
634 | case '7': | 690 | case '7': | |||||||||||
635 | case '8': | 691 | case '8': | |||||||||||
636 | case '9': | 692 | case '9': | |||||||||||
637 | chars[offset++] = (char)ival; | 693 | chars[offset++] = (char)ival; | |||||||||||
638 | lastValidOffset = offset; | 694 | lastValidOffset = offset; | |||||||||||
639 | break; | 695 | break; | |||||||||||
640 | case '.': |
| 697 | case 'E': | ||||||||||
641 | state = SDECDIGIT_STRICT; |
| 698 | state = SEXP_STRICT; | ||||||||||
642 | break states; | 699 | break states; | |||||||||||
643 | case 'e': | 696 | case 'e': | |||||||||||
644 | case 'E': | | ||||||||||||
645 | state = SEXP_STRICT; |
| | |||||||||||
646 | break states; | 709 | break states; | |||||||||||
647 | case '_': | 700 | case '_': | |||||||||||
648 | if (i >= buflen || bytes[i] < '0' || bytes[i] > '9') | 701 | if (i >= buflen || bytes[i] < '0' || bytes[i] > '9') | |||||||||||
649 | state = SERR_NOT_STRICT; | 702 | state = SERR_NOT_STRICT; | |||||||||||
650 | break states; | 703 | break states; | |||||||||||
651 | break; | 704 | break; | |||||||||||
652 | default: | 705 | default: | |||||||||||
653 | for (--i; i < buflen && isWhitespace(bytes[i]); i++) | 706 | for (--i; i < buflen && isWhitespace(bytes[i]); i++) | |||||||||||
654 | ; | 707 | ; | |||||||||||
655 | state = i < buflen ? SERR_NOT_STRICT : SCOMPLETE; | 708 | state = i < buflen ? SERR_NOT_STRICT : SCOMPLETE; | |||||||||||
656 | break states; |
| |
Row | Violation |
---|---|
1 | Unmatched statement state=SEXP_STRICT; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
2 | Unmatched break states; |
3 | Clone fragment #1 returns variables i, ival, offset, chars, lastValidOffset , while Clone fragment #2 returns variables i, ival, offset, chars, lastValidOffset |