6178739: (fmt) Formatter.format("%0.4f\n", 56789.456789) generates MissingFormatWidthException
authorbpb
Tue, 09 Jul 2013 11:26:25 -0700
changeset 18797 ced9bcc861d9
parent 18796 486b43748d9b
child 18798 7109807f56e9
6178739: (fmt) Formatter.format("%0.4f\n", 56789.456789) generates MissingFormatWidthException Summary: Change the field width specification to require a positive value. The exception is still thrown but that is now explicitly consistent with the specification. Reviewed-by: darcy Contributed-by: Brian Burkhalter <brian.burkhalter@oracle.com>
jdk/src/share/classes/java/util/Formatter.java
--- a/jdk/src/share/classes/java/util/Formatter.java	Wed Jul 10 11:05:39 2013 -0700
+++ b/jdk/src/share/classes/java/util/Formatter.java	Tue Jul 09 11:26:25 2013 -0700
@@ -190,7 +190,7 @@
  * <p> The optional <i>flags</i> is a set of characters that modify the output
  * format.  The set of valid flags depends on the conversion.
  *
- * <p> The optional <i>width</i> is a non-negative decimal integer indicating
+ * <p> The optional <i>width</i> is a positive decimal integer indicating
  * the minimum number of characters to be written to the output.
  *
  * <p> The optional <i>precision</i> is a non-negative decimal integer usually