if (state.peek() != 'E') {
return;
}
+ if ((result.groupingSizes & 0xffff0000L) != 0xffff0000L) {
+ throw state.toParseException("Cannot have grouping separator in scientific notation");
+ }
state.next(); // consume the E
result.widthExceptAffixes++;
if (state.peek() == '+') {
{"0E0", "0E0"},
{"#00E00", "#00E00"},
{"#,##0", "#,##0"},
- {"#,##0E0", "#,##0E0"},
{"#;#", "0;0"},
{"#;-#", "0"}, // ignore a negative prefix pattern of '-' since that is the default
{"**##0", "**##0"},
@Test
public void testExceptionOnInvalid() {
String[] invalidPatterns = {
- "#.#.#", "0#", "0#.", ".#0", "0#.#0", "@0", "0@", "0,", "0,,", "0,,0", "0,,0,"
+ "#.#.#", "0#", "0#.", ".#0", "0#.#0", "@0", "0@", "0,", "0,,", "0,,0", "0,,0,", "#,##0E0"
};
for (String pattern : invalidPatterns) {