When I kick off my maven build, it fails with this error
“Conversion = s, Flags = #”
on the below test.
public class Test {
public static void main(String[] argv) {
String a = String.format("%1$#" + (250 + 1) + "s", "");
System.out.println("a = " + a);
}
}
Please advise.
Thanks.
So this is really all down to a call which looks like this:
If you look at the
Formatterdocs, this format string is requesting a string conversion (s) with a width of 251 and a flag of#.The docs for string conversions state:
Now
java.lang.Stringdoesn’t implementFormattable– so the exception is thrown, exactly as documented.What did you expect this to do?