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

ChoiceFormat::format throws undocumented AIOOBE

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P4
    • 22
    • 22
    • core-libs
    • b24
    • generic
    • generic

    Description

      ChoiceFormat can be created with incomplete limits and formats via applyPattern() or setChoices(). Calling format() with those objects throws an AIOOBE

      For example, (the constructors invoke the mentioned setter methods)

      new ChoiceFormat("").format(1); // throws AIOOBE
      new ChoiceFormat(new double[]{}, new String[]{}).format(1); // throws AIOOBE

      It would be great if the setter methods could have made input checks, but for compatibility reasons this cannot be done. At a minimum, the undocumented AIOOBE should be clarified.

      Attachments

        Issue Links

          Activity

            People

              jlu Justin Lu
              jlu Justin Lu
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: