Summary
Remove unimplemented functionality from parameter description of "formats" in "ChoiceFormat.setChoices(double[] limits, String[] formats)".
Problem
setChoices() is currently worded so that formats takes an array of Object that accepts either Format objects or Strings. This is not true as formats takes an array of String. Because of this, the claimed functionality of taking either Format objects or Strings is impossible and unimplemented but exists in the specification.
Solution
Remove the unimplemented claim from the parameter description of formats.
Specification
--- a/src/java.base/share/classes/java/text/ChoiceFormat.java
+++ b/src/java.base/share/classes/java/text/ChoiceFormat.java
* @param formats are the formats you want to use for each limit.
- * They can be either Format objects or Strings.
- * When formatting with object Y,
- * if the object is a NumberFormat, then ((NumberFormat) Y).format(X)
- * is called. Otherwise Y.toString() is called.
* @throws NullPointerException if {@code limits} or
* {@code formats} is {@code null}
*/
- csr of
-
JDK-6960866 [Fmt-Ch] ChoiceFormat claims impossible and unimplemented functionality
- Resolved