# HG changeset patch # User bpb # Date 1372881342 25200 # Node ID a3242677f9666a20208ceda25e103a248afb1491 # Parent bb4ae17c98cf09959cdcdf73e57c95721926de86 8019857: Fix doclint errors in java.util.Format* Summary: Fix doclint errors in java.util.Format*. Reviewed-by: TBD Contributed-by: Brian Burkhalter diff --git a/src/share/classes/java/util/Formattable.java b/src/share/classes/java/util/Formattable.java --- a/src/share/classes/java/util/Formattable.java +++ b/src/share/classes/java/util/Formattable.java @@ -36,7 +36,7 @@ * For example, the following class prints out different representations of a * stock's name depending on the flags and length constraints: * - *
+ * {@code
  *   import java.nio.CharBuffer;
  *   import java.util.Formatter;
  *   import java.util.Formattable;
@@ -89,12 +89,12 @@
  *           return String.format("%s - %s", symbol, companyName);
  *       }
  *   }
- * 
+ * } * *

When used in conjunction with the {@link java.util.Formatter}, the above * class produces the following output for various format strings. * - *

+ * {@code
  *   Formatter fmt = new Formatter();
  *   StockName sn = new StockName("HUGE", "Huge Fruit, Inc.",
  *                                "Fruit Titanesque, Inc.");
@@ -104,7 +104,7 @@
  *   fmt.format("%-10.8s", sn);              //   -> "HUGE      "
  *   fmt.format("%.12s", sn);                //   -> "Huge Fruit,*"
  *   fmt.format(Locale.FRANCE, "%25s", sn);  //   -> "   Fruit Titanesque, Inc."
- * 
+ * } * *

Formattables are not necessarily safe for multithreaded access. Thread * safety is optional and may be enforced by classes that extend and implement diff --git a/src/share/classes/java/util/Formatter.java b/src/share/classes/java/util/Formatter.java --- a/src/share/classes/java/util/Formatter.java +++ b/src/share/classes/java/util/Formatter.java @@ -841,7 +841,7 @@ * *

Numeric types will be formatted according to the following algorithm: * - *

Number Localization Algorithm + *

Number Localization Algorithm * *

After digits are obtained for the integer part, fractional part, and * exponent (as appropriate for the data type), the following transformation @@ -860,7 +860,7 @@ * substituted. * *

  • If the {@code ','} ('\u002c') - * flag is given, then the locale-specific {@linkplain + * flag is given, then the locale-specific {@linkplain * java.text.DecimalFormatSymbols#getGroupingSeparator grouping separator} is * inserted by scanning the integer part of the string from least significant * to most significant digits and inserting a separator at intervals defined by @@ -902,7 +902,7 @@ * {@code 'd'} * '\u0054' * Formats the argument as a decimal integer. The localization algorithm is applied. + * href="#L10nAlgorithm">localization algorithm is applied. * *

    If the {@code '0'} flag is given and the value is negative, then * the zero padding will occur after the sign. @@ -1011,7 +1011,7 @@ * '\u002c' * Requires the output to include the locale-specific {@linkplain * java.text.DecimalFormatSymbols#getGroupingSeparator group separators} as - * described in the "group" section of the + * described in the "group" section of the * localization algorithm. * * {@code '('} @@ -1060,7 +1060,7 @@ * {@code 'd'} * '\u0054' * Requires the output to be formatted as a decimal integer. The localization algorithm is applied. + * href="#L10nAlgorithm">localization algorithm is applied. * *

    If the {@code '#'} flag is given {@link * FormatFlagsConversionMismatchException} will be thrown. @@ -1155,7 +1155,7 @@ * '\u0065' * Requires the output to be formatted using computerized scientific notation. The localization algorithm is applied. + * href="#L10nAlgorithm">localization algorithm is applied. * *

    The formatting of the magnitude m depends upon its value. * @@ -1168,7 +1168,7 @@ * *

    Otherwise, the result is a string that represents the sign and * magnitude (absolute value) of the argument. The formatting of the sign - * is described in the localization + * is described in the localization * algorithm. The formatting of the magnitude m depends upon its * value. * @@ -1207,7 +1207,7 @@ * {@code 'g'} * '\u0067' * Requires the output to be formatted in general scientific notation - * as described below. The localization + * as described below. The localization * algorithm is applied. * *

    After rounding for the precision, the formatting of the resulting @@ -1236,12 +1236,12 @@ * {@code 'f'} * '\u0066' * Requires the output to be formatted using decimal - * format. The localization algorithm is + * format. The localization algorithm is * applied. * *

    The result is a string that represents the sign and magnitude * (absolute value) of the argument. The formatting of the sign is - * described in the localization + * described in the localization * algorithm. The formatting of the magnitude m depends upon its * value. * @@ -1382,7 +1382,7 @@ * '\u0065' * Requires the output to be formatted using computerized scientific notation. The localization algorithm is applied. + * href="#L10nAlgorithm">localization algorithm is applied. * *

    The formatting of the magnitude m depends upon its value. * @@ -1391,7 +1391,7 @@ * *

    Otherwise, the result is a string that represents the sign and * magnitude (absolute value) of the argument. The formatting of the sign - * is described in the localization + * is described in the localization * algorithm. The formatting of the magnitude m depends upon its * value. * @@ -1428,7 +1428,7 @@ * {@code 'g'} * '\u0067' * Requires the output to be formatted in general scientific notation - * as described below. The localization + * as described below. The localization * algorithm is applied. * *

    After rounding for the precision, the formatting of the resulting @@ -1457,12 +1457,12 @@ * {@code 'f'} * '\u0066' * Requires the output to be formatted using decimal - * format. The localization algorithm is + * format. The localization algorithm is * applied. * *

    The result is a string that represents the sign and magnitude * (absolute value) of the argument. The formatting of the sign is - * described in the localization + * described in the localization * algorithm. The formatting of the magnitude m depends upon its * value. * @@ -1721,7 +1721,7 @@ * conversions applies. If the {@code '#'} flag is given, then a {@link * FormatFlagsConversionMismatchException} will be thrown. * - *

    The width is the minimum number of characters to + *

    The width is the minimum number of characters to * be written to the output. If the length of the converted value is less than * the {@code width} then the output will be padded by spaces * ('\u0020') until the total number of characters equals width. @@ -1741,7 +1741,7 @@ * {@code '%'} * The result is a literal {@code '%'} ('\u0025') * - *

    The width is the minimum number of characters to + *

    The width is the minimum number of characters to * be written to the output including the {@code '%'}. If the length of the * converted value is less than the {@code width} then the output will be * padded by spaces ('\u0020') until the total number of @@ -2590,7 +2590,20 @@ public String toString() { return s; } } - public enum BigDecimalLayoutForm { SCIENTIFIC, DECIMAL_FLOAT }; + /** + * Enum for {@code BigDecimal} formatting. + */ + public enum BigDecimalLayoutForm { + /** + * Format the {@code BigDecimal} in computerized scientific notation. + */ + SCIENTIFIC, + + /** + * Format the {@code BigDecimal} as a decimal number. + */ + DECIMAL_FLOAT + }; private class FormatSpecifier implements FormatString { private int index = -1;