< prev index next >

src/java.base/share/classes/java/text/ChoiceFormat.java

Print this page
rev 56290 : 8230648: Replace @exception tag with @throws in java.base
Summary: Minor coding style update of javadoc tag in any file in java.base
Reviewed-by: prappo, lancea

*** 172,182 **** private static final long serialVersionUID = 1795184449645032964L; /** * Sets the pattern. * @param newPattern See the class description. ! * @exception NullPointerException if {@code newPattern} * is {@code null} */ public void applyPattern(String newPattern) { StringBuffer[] segments = new StringBuffer[2]; for (int i = 0; i < segments.length; ++i) { --- 172,182 ---- private static final long serialVersionUID = 1795184449645032964L; /** * Sets the pattern. * @param newPattern See the class description. ! * @throws NullPointerException if {@code newPattern} * is {@code null} */ public void applyPattern(String newPattern) { StringBuffer[] segments = new StringBuffer[2]; for (int i = 0; i < segments.length; ++i) {
*** 311,321 **** /** * Constructs with limits and corresponding formats based on the pattern. * * @param newPattern the new pattern string ! * @exception NullPointerException if {@code newPattern} is * {@code null} * @see #applyPattern */ public ChoiceFormat(String newPattern) { applyPattern(newPattern); --- 311,321 ---- /** * Constructs with limits and corresponding formats based on the pattern. * * @param newPattern the new pattern string ! * @throws NullPointerException if {@code newPattern} is * {@code null} * @see #applyPattern */ public ChoiceFormat(String newPattern) { applyPattern(newPattern);
*** 324,334 **** /** * Constructs with the limits and the corresponding formats. * * @param limits limits in ascending order * @param formats corresponding format strings ! * @exception NullPointerException if {@code limits} or {@code formats} * is {@code null} * @see #setChoices */ public ChoiceFormat(double[] limits, String[] formats) { setChoices(limits, formats); --- 324,334 ---- /** * Constructs with the limits and the corresponding formats. * * @param limits limits in ascending order * @param formats corresponding format strings ! * @throws NullPointerException if {@code limits} or {@code formats} * is {@code null} * @see #setChoices */ public ChoiceFormat(double[] limits, String[] formats) { setChoices(limits, formats);
*** 345,355 **** * @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. ! * @exception NullPointerException if {@code limits} or * {@code formats} is {@code null} */ public void setChoices(double[] limits, String formats[]) { if (limits.length != formats.length) { throw new IllegalArgumentException( --- 345,355 ---- * @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} */ public void setChoices(double[] limits, String formats[]) { if (limits.length != formats.length) { throw new IllegalArgumentException(
*** 394,404 **** /** * Returns pattern with formatted double. * @param number number to be formatted and substituted. * @param toAppendTo where text is appended. * @param status ignore no useful status is returned. ! * @exception NullPointerException if {@code toAppendTo} * is {@code null} */ public StringBuffer format(double number, StringBuffer toAppendTo, FieldPosition status) { // find the number --- 394,404 ---- /** * Returns pattern with formatted double. * @param number number to be formatted and substituted. * @param toAppendTo where text is appended. * @param status ignore no useful status is returned. ! * @throws NullPointerException if {@code toAppendTo} * is {@code null} */ public StringBuffer format(double number, StringBuffer toAppendTo, FieldPosition status) { // find the number
*** 424,434 **** * occurred, status.index is set to the first unparsed character * in the source text. On exit, if an error did occur, * status.index is unchanged and status.errorIndex is set to the * first index of the character that caused the parse to fail. * @return A Number representing the value of the number parsed. ! * @exception NullPointerException if {@code status} is {@code null} * or if {@code text} is {@code null} and the list of * choice strings is not empty. */ public Number parse(String text, ParsePosition status) { // find the best number (defined as the one with the longest parse) --- 424,434 ---- * occurred, status.index is set to the first unparsed character * in the source text. On exit, if an error did occur, * status.index is unchanged and status.errorIndex is set to the * first index of the character that caused the parse to fail. * @return A Number representing the value of the number parsed. ! * @throws NullPointerException if {@code status} is {@code null} * or if {@code text} is {@code null} and the list of * choice strings is not empty. */ public Number parse(String text, ParsePosition status) { // find the best number (defined as the one with the longest parse)
< prev index next >