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

ChoiceFormat inconsistency between applyPattern() and setChoices()

    XMLWordPrintable

Details

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

    Description

      ChoiceFormat::applyPattern does not allow intervals to be set in non-ascending order.

      ChoiceFormat::setChoices does allow intervals to be set in non-ascending order.

      These setter methods should be able to create consistent ChoiceFormat objects.

      For example,

      new ChoiceFormat(new double[]{1,1}, new String[]{"foo","bar"}) // no exception
      new ChoiceFormat("1#foo|1#bar") // throws exception

      It would be great if these could be consistent, but changes at this point would cause compatibility issues. This difference should at least be emphasized in the specification.

      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: