(boolean firstElement)
| 666 | } |
| 667 | |
| 668 | @SuppressWarnings("fallthrough") |
| 669 | private JsonToken nextInArray(boolean firstElement) throws IOException { |
| 670 | if (firstElement) { |
| 671 | replaceTop(JsonScope.NONEMPTY_ARRAY); |
| 672 | } else { |
| 673 | /* Look for a comma before each element after the first element. */ |
| 674 | switch (nextNonWhitespace()) { |
| 675 | case ']': |
| 676 | pop(); |
| 677 | hasToken = true; |
| 678 | return token = JsonToken.END_ARRAY; |
| 679 | case ';': |
| 680 | checkLenient(); // fall-through |
| 681 | case ',': |
| 682 | break; |
| 683 | default: |
| 684 | throw syntaxError("Unterminated array"); |
| 685 | } |
| 686 | } |
| 687 | |
| 688 | switch (nextNonWhitespace()) { |
| 689 | case ']': |
| 690 | if (firstElement) { |
| 691 | pop(); |
| 692 | hasToken = true; |
| 693 | return token = JsonToken.END_ARRAY; |
| 694 | } |
| 695 | // fall-through to handle ",]" |
| 696 | case ';': |
| 697 | case ',': |
| 698 | /* In lenient mode, a 0-length literal means 'null' */ |
| 699 | checkLenient(); |
| 700 | pos--; |
| 701 | hasToken = true; |
| 702 | value = "null"; |
| 703 | return token = JsonToken.NULL; |
| 704 | default: |
| 705 | pos--; |
| 706 | return nextValue(); |
| 707 | } |
| 708 | } |
| 709 | |
| 710 | @SuppressWarnings("fallthrough") |
| 711 | private JsonToken nextInObject(boolean firstElement) throws IOException { |
no test coverage detected