@@ -176,6 +176,8 @@ public class ChoiceFormat extends NumberFormat {
176
176
* @param newPattern See the class description.
177
177
* @throws NullPointerException if {@code newPattern}
178
178
* is {@code null}
179
+ * @throws IllegalArgumentException if {@code newPattern}
180
+ * is invalid
179
181
*/
180
182
public void applyPattern (String newPattern ) {
181
183
StringBuilder [] segments = new StringBuilder [2 ];
@@ -315,6 +317,8 @@ public String toPattern() {
315
317
* @param newPattern the new pattern string
316
318
* @throws NullPointerException if {@code newPattern} is
317
319
* {@code null}
320
+ * @throws IllegalArgumentException if {@code newPattern}
321
+ * is invalid
318
322
* @see #applyPattern
319
323
*/
320
324
public ChoiceFormat (String newPattern ) {
@@ -328,6 +332,8 @@ public ChoiceFormat(String newPattern) {
328
332
* @param formats corresponding format strings
329
333
* @throws NullPointerException if {@code limits} or {@code formats}
330
334
* is {@code null}
335
+ * @throws IllegalArgumentException if the length of {@code limits}
336
+ * and {@code formats} are not equal
331
337
* @see #setChoices
332
338
*/
333
339
public ChoiceFormat (double [] limits , String [] formats ) {
@@ -345,11 +351,13 @@ public ChoiceFormat(double[] limits, String[] formats) {
345
351
* @param formats are the formats you want to use for each limit.
346
352
* @throws NullPointerException if {@code limits} or
347
353
* {@code formats} is {@code null}
354
+ * @throws IllegalArgumentException if the length of {@code limits}
355
+ * and {@code formats} are not equal
348
356
*/
349
357
public void setChoices (double [] limits , String [] formats ) {
350
358
if (limits .length != formats .length ) {
351
359
throw new IllegalArgumentException (
352
- "Array and limit arrays must be of the same length." );
360
+ "Input arrays must be of the same length." );
353
361
}
354
362
choiceLimits = Arrays .copyOf (limits , limits .length );
355
363
choiceFormats = Arrays .copyOf (formats , formats .length );
0 commit comments