equal
deleted
inserted
replaced
928 /** |
928 /** |
929 * Writes a formatted string to this output stream using the specified |
929 * Writes a formatted string to this output stream using the specified |
930 * format string and arguments. |
930 * format string and arguments. |
931 * |
931 * |
932 * <p> The locale always used is the one returned by {@link |
932 * <p> The locale always used is the one returned by {@link |
933 * java.util.Locale#getDefault() Locale.getDefault()}, regardless of any |
933 * java.util.Locale#getDefault(Locale.Category)} with |
934 * previous invocations of other formatting methods on this object. |
934 * {@link java.util.Locale.Category#FORMAT FORMAT} category specified, |
|
935 * regardless of any previous invocations of other formatting methods on |
|
936 * this object. |
935 * |
937 * |
936 * @param format |
938 * @param format |
937 * A format string as described in <a |
939 * A format string as described in <a |
938 * href="../util/Formatter.html#syntax">Format string syntax</a> |
940 * href="../util/Formatter.html#syntax">Format string syntax</a> |
939 * |
941 * |
967 public PrintStream format(String format, Object ... args) { |
969 public PrintStream format(String format, Object ... args) { |
968 try { |
970 try { |
969 synchronized (this) { |
971 synchronized (this) { |
970 ensureOpen(); |
972 ensureOpen(); |
971 if ((formatter == null) |
973 if ((formatter == null) |
972 || (formatter.locale() != Locale.getDefault())) |
974 || (formatter.locale() != |
|
975 Locale.getDefault(Locale.Category.FORMAT))) |
973 formatter = new Formatter((Appendable) this); |
976 formatter = new Formatter((Appendable) this); |
974 formatter.format(Locale.getDefault(), format, args); |
977 formatter.format(Locale.getDefault(Locale.Category.FORMAT), |
|
978 format, args); |
975 } |
979 } |
976 } catch (InterruptedIOException x) { |
980 } catch (InterruptedIOException x) { |
977 Thread.currentThread().interrupt(); |
981 Thread.currentThread().interrupt(); |
978 } catch (IOException x) { |
982 } catch (IOException x) { |
979 trouble = true; |
983 trouble = true; |