8333755: NumberFormat integer only parsing breaks when format has suffix

Reviewed-by: naoto
This commit is contained in:
Justin Lu 2024-06-26 17:10:09 +00:00
parent b5d589623c
commit bffc8484c3
5 changed files with 169 additions and 101 deletions

View file

@ -468,12 +468,11 @@ public abstract class NumberFormat extends Format {
}
/**
* Returns true if this format will parse numbers as integers only.
* Returns {@code true} if this format will parse numbers as integers only.
* The {@code ParsePosition} index will be set to the position of the decimal
* symbol. The exact format accepted by the parse operation is locale dependent.
* For example in the English locale, with ParseIntegerOnly true, the
* string "1234." would be parsed as the integer value 1234 and parsing
* would stop at the "." character. Of course, the exact format accepted
* by the parse operation is locale dependent and determined by sub-classes
* of NumberFormat.
* string "123.45" would be parsed as the integer value 123.
*
* @return {@code true} if numbers should be parsed as integers only;
* {@code false} otherwise