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.
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.
- csr for
-
JDK-8318192 ChoiceFormat inconsistency between applyPattern() and setChoices()
- Closed