On Mon, 20 Jul 2026 23:12:18 GMT, Justin Lu <[email protected]> wrote:
> This PR corrects two parsing issues for `DecimalFormat` during strict parsing. > > 1. The special parsing path for NaN was shared by lenient and strict > parsing. As a result, subsequent text after the "NaN" was accepted in strict > mode, although the trailing characters should have caused parsing to fail. > Strict parsing needs to add additional logic for that special case. > > 2. In strict mode, a grouping size of zero causes all numeric input to be > rejected since it tries to check for the first group immediately. A grouping > size of zero is implies that grouping is not used. However, `isGroupingUsed` > is independent of `setGroupingSize`. The implementation needs to check for > both the int size and boolean status value when checking grouping during > strict parsing. > > --------- > - [x] I confirm that I make this contribution in accordance with the [OpenJDK > Interim AI Policy](https://openjdk.org/legal/ai). This pull request has now been integrated. Changeset: 30471d74 Author: Justin Lu <[email protected]> URL: https://git.openjdk.org/jdk/commit/30471d74345d406ce78e2ecbe5cda0d8bfdba3bf Stats: 61 lines in 3 files changed: 40 ins; 2 del; 19 mod 8388507: DecimalFormat Strict Parsing NaN and Grouping Size Zero Fixes Reviewed-by: naoto ------------- PR: https://git.openjdk.org/jdk/pull/31980
