As per the JDK7 spec wrt Formatter.format(), for the following conversion chars: b|B, h|H, s|S, IllegalArgumentException is not expected in for any argument value. For e.g., consider conversion char 'b', as per the spec:- 'If the argument is null, then the result is "false". If arg is a boolean or Boolean, then the result is the string returned by String.valueOf(). Otherwise, the result is "true".'
Yet noticed that for String.format("%b", new Object[]{}), I get IAE. Instead I was expecting the "Otherwise" clause, that is a return value of: "true".
Similar case noticed with other conversion chars such as: h|H, s|S.
See attached testcase and the test output against JDK7 RI.
Yet noticed that for String.format("%b", new Object[]{}), I get IAE. Instead I was expecting the "Otherwise" clause, that is a return value of: "true".
Similar case noticed with other conversion chars such as: h|H, s|S.
See attached testcase and the test output against JDK7 RI.