< prev index next >
src/java.base/share/classes/java/text/DecimalFormat.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
@@ -423,12 +423,12 @@
* on NumberFormat such as getNumberInstance. These factories will
* return the most appropriate sub-class of NumberFormat for a given
* locale.
*
* @param pattern a non-localized pattern string.
- * @exception NullPointerException if {@code pattern} is null
- * @exception IllegalArgumentException if the given pattern is invalid.
+ * @throws NullPointerException if {@code pattern} is null
+ * @throws IllegalArgumentException if the given pattern is invalid.
* @see java.text.NumberFormat#getInstance
* @see java.text.NumberFormat#getNumberInstance
* @see java.text.NumberFormat#getCurrencyInstance
* @see java.text.NumberFormat#getPercentInstance
*/
@@ -450,12 +450,12 @@
* to a standard format, you can modify the format returned by
* a NumberFormat factory method.
*
* @param pattern a non-localized pattern string
* @param symbols the set of symbols to be used
- * @exception NullPointerException if any of the given arguments is null
- * @exception IllegalArgumentException if the given pattern is invalid
+ * @throws NullPointerException if any of the given arguments is null
+ * @throws IllegalArgumentException if the given pattern is invalid
* @see java.text.NumberFormat#getInstance
* @see java.text.NumberFormat#getNumberInstance
* @see java.text.NumberFormat#getCurrencyInstance
* @see java.text.NumberFormat#getPercentInstance
* @see java.text.DecimalFormatSymbols
@@ -484,15 +484,15 @@
* {@link NumberFormat#INTEGER_FIELD}, the begin index
* and end index of {@code fieldPosition} will be set
* to 0 and 9, respectively for the output string
* {@code 1,234,567.89}.
* @return the value passed in as {@code toAppendTo}
- * @exception IllegalArgumentException if {@code number} is
+ * @throws IllegalArgumentException if {@code number} is
* null or not an instance of {@code Number}.
- * @exception NullPointerException if {@code toAppendTo} or
+ * @throws NullPointerException if {@code toAppendTo} or
* {@code pos} is null
- * @exception ArithmeticException if rounding is needed with rounding
+ * @throws ArithmeticException if rounding is needed with rounding
* mode being set to RoundingMode.UNNECESSARY
* @see java.text.FieldPosition
*/
@Override
public final StringBuffer format(Object number,
@@ -526,13 +526,13 @@
* locale, if the given {@code fieldPosition} is
* {@link NumberFormat#INTEGER_FIELD}, the begin index
* and end index of {@code fieldPosition} will be set
* to 0 and 9, respectively for the output string
* {@code 1,234,567.89}.
- * @exception NullPointerException if {@code result} or
+ * @throws NullPointerException if {@code result} or
* {@code fieldPosition} is {@code null}
- * @exception ArithmeticException if rounding is needed with rounding
+ * @throws ArithmeticException if rounding is needed with rounding
* mode being set to RoundingMode.UNNECESSARY
* @return The formatted number string
* @see java.text.FieldPosition
*/
@Override
@@ -563,11 +563,11 @@
/**
* Formats a double to produce a string.
* @param number The double to format
* @param result where the text is to be appended
* @param delegate notified of locations of sub fields
- * @exception ArithmeticException if rounding is needed with rounding
+ * @throws ArithmeticException if rounding is needed with rounding
* mode being set to RoundingMode.UNNECESSARY
* @return The formatted number string
*/
StringBuffer format(double number, StringBuffer result,
FieldDelegate delegate) {
@@ -696,13 +696,13 @@
* locale, if the given {@code fieldPosition} is
* {@link NumberFormat#INTEGER_FIELD}, the begin index
* and end index of {@code fieldPosition} will be set
* to 0 and 11, respectively for the output string
* {@code 123,456,789}.
- * @exception NullPointerException if {@code result} or
+ * @throws NullPointerException if {@code result} or
* {@code fieldPosition} is {@code null}
- * @exception ArithmeticException if rounding is needed with rounding
+ * @throws ArithmeticException if rounding is needed with rounding
* mode being set to RoundingMode.UNNECESSARY
* @return The formatted number string
* @see java.text.FieldPosition
*/
@Override
@@ -718,11 +718,11 @@
* Format a long to produce a string.
* @param number The long to format
* @param result where the text is to be appended
* @param delegate notified of locations of sub fields
* @return The formatted number string
- * @exception ArithmeticException if rounding is needed with rounding
+ * @throws ArithmeticException if rounding is needed with rounding
* mode being set to RoundingMode.UNNECESSARY
* @see java.text.FieldPosition
*/
StringBuffer format(long number, StringBuffer result,
FieldDelegate delegate) {
@@ -793,11 +793,11 @@
* {@link NumberFormat#INTEGER_FIELD}, the begin index
* and end index of {@code fieldPosition} will be set
* to 0 and 9, respectively for the output string
* {@code 1,234,567.89}.
* @return The formatted number string
- * @exception ArithmeticException if rounding is needed with rounding
+ * @throws ArithmeticException if rounding is needed with rounding
* mode being set to RoundingMode.UNNECESSARY
* @see java.text.FieldPosition
*/
private StringBuffer format(BigDecimal number, StringBuffer result,
FieldPosition fieldPosition) {
@@ -809,11 +809,11 @@
/**
* Formats a BigDecimal to produce a string.
* @param number The BigDecimal to format
* @param result where the text is to be appended
* @param delegate notified of locations of sub fields
- * @exception ArithmeticException if rounding is needed with rounding
+ * @throws ArithmeticException if rounding is needed with rounding
* mode being set to RoundingMode.UNNECESSARY
* @return The formatted number string
*/
StringBuffer format(BigDecimal number, StringBuffer result,
FieldDelegate delegate) {
@@ -852,11 +852,11 @@
* {@link NumberFormat#INTEGER_FIELD}, the begin index
* and end index of {@code fieldPosition} will be set
* to 0 and 11, respectively for the output string
* {@code 123,456,789}.
* @return The formatted number string
- * @exception ArithmeticException if rounding is needed with rounding
+ * @throws ArithmeticException if rounding is needed with rounding
* mode being set to RoundingMode.UNNECESSARY
* @see java.text.FieldPosition
*/
private StringBuffer format(BigInteger number, StringBuffer result,
FieldPosition fieldPosition) {
@@ -870,11 +870,11 @@
* Format a BigInteger to produce a string.
* @param number The BigInteger to format
* @param result where the text is to be appended
* @param delegate notified of locations of sub fields
* @return The formatted number string
- * @exception ArithmeticException if rounding is needed with rounding
+ * @throws ArithmeticException if rounding is needed with rounding
* mode being set to RoundingMode.UNNECESSARY
* @see java.text.FieldPosition
*/
StringBuffer format(BigInteger number, StringBuffer result,
FieldDelegate delegate, boolean formatLong) {
@@ -921,14 +921,14 @@
* <p>
* Each attribute key of the AttributedCharacterIterator will be of type
* {@code NumberFormat.Field}, with the attribute value being the
* same as the attribute key.
*
- * @exception NullPointerException if obj is null.
- * @exception IllegalArgumentException when the Format cannot format the
+ * @throws NullPointerException if obj is null.
+ * @throws IllegalArgumentException when the Format cannot format the
* given object.
- * @exception ArithmeticException if rounding is needed with rounding
+ * @throws ArithmeticException if rounding is needed with rounding
* mode being set to RoundingMode.UNNECESSARY
* @param obj The object to format
* @return AttributedCharacterIterator describing the formatted value.
* @since 1.4
*/
@@ -2128,11 +2128,11 @@
*
* @param text the string to be parsed
* @param pos A {@code ParsePosition} object with index and error
* index information as described above.
* @return the parsed value, or {@code null} if the parse fails
- * @exception NullPointerException if {@code text} or
+ * @throws NullPointerException if {@code text} or
* {@code pos} is null.
*/
@Override
public Number parse(String text, ParsePosition pos) {
// special case NaN
@@ -3252,12 +3252,12 @@
* parentheses.
* <p>In negative patterns, the minimum and maximum counts are ignored;
* these are presumed to be set in the positive pattern.
*
* @param pattern a new pattern
- * @exception NullPointerException if {@code pattern} is null
- * @exception IllegalArgumentException if the given pattern is invalid.
+ * @throws NullPointerException if {@code pattern} is null
+ * @throws IllegalArgumentException if the given pattern is invalid.
*/
public void applyPattern(String pattern) {
applyPattern(pattern, false);
}
@@ -3279,12 +3279,12 @@
* parentheses.
* <p>In negative patterns, the minimum and maximum counts are ignored;
* these are presumed to be set in the positive pattern.
*
* @param pattern a new pattern
- * @exception NullPointerException if {@code pattern} is null
- * @exception IllegalArgumentException if the given pattern is invalid.
+ * @throws NullPointerException if {@code pattern} is null
+ * @throws IllegalArgumentException if the given pattern is invalid.
*/
public void applyLocalizedPattern(String pattern) {
applyPattern(pattern, true);
}
@@ -3780,11 +3780,11 @@
* The currency is set by calling
* {@link DecimalFormatSymbols#setCurrency DecimalFormatSymbols.setCurrency}
* on this number format's symbols.
*
* @param currency the new currency to be used by this decimal format
- * @exception NullPointerException if {@code currency} is null
+ * @throws NullPointerException if {@code currency} is null
* @since 1.4
*/
@Override
public void setCurrency(Currency currency) {
if (currency != symbols.getCurrency()) {
@@ -3811,11 +3811,11 @@
/**
* Sets the {@link java.math.RoundingMode} used in this DecimalFormat.
*
* @param roundingMode The {@code RoundingMode} to be used
* @see #getRoundingMode()
- * @exception NullPointerException if {@code roundingMode} is null.
+ * @throws NullPointerException if {@code roundingMode} is null.
* @since 1.6
*/
@Override
public void setRoundingMode(RoundingMode roundingMode) {
if (roundingMode == null) {
< prev index next >