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).

-------------

Commit messages:
 - Fix strict parsing with grouping size 0
 - Fix strict NaN handling
 - Drive by typo fix

Changes: https://git.openjdk.org/jdk/pull/31980/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=31980&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8388507
  Stats: 60 lines in 3 files changed: 39 ins; 2 del; 19 mod
  Patch: https://git.openjdk.org/jdk/pull/31980.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/31980/head:pull/31980

PR: https://git.openjdk.org/jdk/pull/31980

Reply via email to