Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/java.base/share/classes/java/util/FormatterBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -320,14 +320,16 @@ private MethodHandle formatSpecifier(FormatSpecifier fs, Class<?> ptype) {
}
case DECIMAL_INTEGER -> {
if ((itype == int.class || itype == long.class) && precision == -1) {
if (flags == 0 && isGenericDFS && width == -1) {
return mh;
}

if (itype == int.class) {
mh = explicitCastArguments(mh,
mh.type().changeReturnType(long.class));
}

if (flags == 0 && isGenericDFS && width == -1) {
return mh;
} else if (validFlags(flags, PLUS | LEADING_SPACE |
if (validFlags(flags, PLUS | LEADING_SPACE |
ZERO_PAD | GROUP |
PARENTHESES)) {
handled = true;
Expand Down