From 7816fc6dded327ba23cd21a66dee2a642ed02b87 Mon Sep 17 00:00:00 2001 From: Brian Burkhalter Date: Tue, 9 Jul 2013 11:26:25 -0700 Subject: [PATCH] 6178739: (fmt) Formatter.format("%0.4f\n", 56789.456789) generates MissingFormatWidthException 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 --- jdk/src/share/classes/java/util/Formatter.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jdk/src/share/classes/java/util/Formatter.java b/jdk/src/share/classes/java/util/Formatter.java index dae0b37f48b..5c096c63acf 100644 --- a/jdk/src/share/classes/java/util/Formatter.java +++ b/jdk/src/share/classes/java/util/Formatter.java @@ -190,7 +190,7 @@ import sun.misc.FormattedFloatingDecimal; *

The optional flags is a set of characters that modify the output * format. The set of valid flags depends on the conversion. * - *

The optional width is a non-negative decimal integer indicating + *

The optional width is a positive decimal integer indicating * the minimum number of characters to be written to the output. * *

The optional precision is a non-negative decimal integer usually