Java 8 RFR: 6178739 - Formatter (original) (raw)
Java 8 RFR: 6178739 - Formatter - Zero padding flag with zero width
Brian Burkhalter brian.burkhalter at oracle.com
Fri Jun 28 19:10:59 UTC 2013
- Previous message: hg: jdk8/tl/jdk: 8019384: jps and jcmd tests fail when there is a process started with a .war file
- Next message: Review needed for ResultSet.next typo bug 8019286
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Continuing this thread
http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-June/018326.html
with respect to this issue
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6178739
this Request for Review proposes the following change to the Formatter javadoc specification:
diff -r 8d577b3a6ca4 src/share/classes/java/util/Formatter.java --- a/src/share/classes/java/util/Formatter.java Fri Jun 28 11:09:10 2013 -0700 +++ b/src/share/classes/java/util/Formatter.java Fri Jun 28 11:58:45 2013 -0700 @@ -190,7 +190,7 @@
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
The change is to require the field width to be positive rather than non-negative. Allowing a zero minimum field width seems meaningless. This matches the current behavior as defined by the format specifier regular expression:
private static final String formatSpecifier
= "%(\\d+\\$)?([-#+ 0,(\\<]*)?(\\d+)?(\\.\\d+)?([tT])?([a-zA-Z%])";
A CCC request for the above would naturally need to be approved if this is change were deemed acceptable.
An alternative, as previously stated, would be to handle cases like %0.4f specially but this seems to violate the letter of the specification as currently written. It would however match the behavior of C and not require a CCC request, FWIW.
Thanks,
Brian
- Previous message: hg: jdk8/tl/jdk: 8019384: jps and jcmd tests fail when there is a process started with a .war file
- Next message: Review needed for ResultSet.next typo bug 8019286
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]