Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8251499

no-placeholder compact number patterns throw IllegalArgumentException

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 16
    • Fix Version/s: 16
    • Component/s: core-libs
    • Labels:
      None
    • Subcomponent:
    • Resolved In Build:
      b12
    • CPU:
      generic
    • OS:
      generic

      Description

      Upcoming CLDR 38 will have compact number patterns without a placeholder:

      https://unicode-org.atlassian.net/browse/CLDR-11045

      Current JDK will throw an exception for such pattern as:

      ```
      java.lang.IllegalArgumentException: Invalid pattern [Kun]: all patterns must include digit placement 0s
      at java.base/java.text.CompactNumberFormat.applyPattern(CompactNumberFormat.java:1405)
      at java.base/java.text.CompactNumberFormat.lambda$processCompactPatterns$0(CompactNumberFormat.java:1167)
      at java.base/java.util.regex.Matcher$1MatchResultIterator.forEachRemaining(Matcher.java:1358)
      at java.base/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
      at java.base/java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:658)
      at java.base/java.text.CompactNumberFormat.processCompactPatterns(CompactNumberFormat.java:1167)
      at java.base/java.text.CompactNumberFormat.<init>(CompactNumberFormat.java:464)
      ```

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              naoto Naoto Sato
              Reporter:
              naoto Naoto Sato
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: