In the Javadoc for java.util.Formatter, in the "Flags" section, the table shows "y" (meaning "the flag is supported for the indicated argument types") for flag '#' and "Floating Point" types.
However, there are actually some combinations that are not supported. In particular, these format strings generate an exception "%#g" and "%#G".
The table entry should have a footnote that notes these two exceptions - or if the exception is unintended, it should be fixed (I'm not sure which is the case).
Reproducer:
$ jshell
| Welcome to JShell -- Version 25
| For an introduction type: /help intro
jshell> String.format("%#e", 3.35);
$1 ==> "3.350000e+00"
jshell> String.format("%#E", 3.35);
$2 ==> "3.350000E+00"
jshell> String.format("%#f", 3.35);
$3 ==> "3.350000"
jshell> String.format("%#g", 3.35);
| Exception java.util.FormatFlagsConversionMismatchException: Conversion = g, Flags = #
| at Formatter$FormatSpecifier.failMismatch (Formatter.java:4658)
| at Formatter$FormatSpecifier.checkBadFlags (Formatter.java:3410)
| at Formatter$FormatSpecifier.checkFloat (Formatter.java:3422)
| at Formatter$FormatSpecifier.check (Formatter.java:3139)
| at Formatter$FormatSpecifier.<init> (Formatter.java:3126)
| at Formatter$FormatSpecifierParser.parse (Formatter.java:2915)
| at Formatter.parse (Formatter.java:2814)
| at Formatter.format (Formatter.java:2744)
| at Formatter.format (Formatter.java:2698)
| at String.format (String.java:4455)
| at (#1:1)
jshell> String.format("%#G", 3.35);
| Exception java.util.FormatFlagsConversionMismatchException: Conversion = g, Flags = #
| at Formatter$FormatSpecifier.failMismatch (Formatter.java:4658)
| at Formatter$FormatSpecifier.checkBadFlags (Formatter.java:3410)
| at Formatter$FormatSpecifier.checkFloat (Formatter.java:3422)
| at Formatter$FormatSpecifier.check (Formatter.java:3139)
| at Formatter$FormatSpecifier.<init> (Formatter.java:3126)
| at Formatter$FormatSpecifierParser.parse (Formatter.java:2915)
| at Formatter.parse (Formatter.java:2814)
| at Formatter.format (Formatter.java:2744)
| at Formatter.format (Formatter.java:2698)
| at String.format (String.java:4455)
| at (#2:1)
However, there are actually some combinations that are not supported. In particular, these format strings generate an exception "%#g" and "%#G".
The table entry should have a footnote that notes these two exceptions - or if the exception is unintended, it should be fixed (I'm not sure which is the case).
Reproducer:
$ jshell
| Welcome to JShell -- Version 25
| For an introduction type: /help intro
jshell> String.format("%#e", 3.35);
$1 ==> "3.350000e+00"
jshell> String.format("%#E", 3.35);
$2 ==> "3.350000E+00"
jshell> String.format("%#f", 3.35);
$3 ==> "3.350000"
jshell> String.format("%#g", 3.35);
| Exception java.util.FormatFlagsConversionMismatchException: Conversion = g, Flags = #
| at Formatter$FormatSpecifier.failMismatch (Formatter.java:4658)
| at Formatter$FormatSpecifier.checkBadFlags (Formatter.java:3410)
| at Formatter$FormatSpecifier.checkFloat (Formatter.java:3422)
| at Formatter$FormatSpecifier.check (Formatter.java:3139)
| at Formatter$FormatSpecifier.<init> (Formatter.java:3126)
| at Formatter$FormatSpecifierParser.parse (Formatter.java:2915)
| at Formatter.parse (Formatter.java:2814)
| at Formatter.format (Formatter.java:2744)
| at Formatter.format (Formatter.java:2698)
| at String.format (String.java:4455)
| at (#1:1)
jshell> String.format("%#G", 3.35);
| Exception java.util.FormatFlagsConversionMismatchException: Conversion = g, Flags = #
| at Formatter$FormatSpecifier.failMismatch (Formatter.java:4658)
| at Formatter$FormatSpecifier.checkBadFlags (Formatter.java:3410)
| at Formatter$FormatSpecifier.checkFloat (Formatter.java:3422)
| at Formatter$FormatSpecifier.check (Formatter.java:3139)
| at Formatter$FormatSpecifier.<init> (Formatter.java:3126)
| at Formatter$FormatSpecifierParser.parse (Formatter.java:2915)
| at Formatter.parse (Formatter.java:2814)
| at Formatter.format (Formatter.java:2744)
| at Formatter.format (Formatter.java:2698)
| at String.format (String.java:4455)
| at (#2:1)