<i18n dev> RFR: 8313205: Modernize java.text.Format with StringBuilder

Chen Liang liach at openjdk.org
Thu Jul 25 23:31:36 UTC 2024


On Thu, 25 Jul 2024 22:18:03 GMT, Justin Lu <jlu at openjdk.org> wrote:

> Please review this PR which adds public StringBuilder overloads to the formatting methods of java.text.Format and implementing subclasses.
> 
> While Format, NumberFormat, and DateFormat are abstract, these new methods are not added as abstract to prevent compatibility concerns. Instead they are added as non-abstract methods, with a default implementation that throws UOE and a recommendation that subclasses override and provide their own implementations. These new methods use the same specification as the StringBuffer ones, with exception of `MessageFormat.format(format(Object[] arguments, StringBuilder result, FieldPosition pos)` which omits the table, and instead links to it.
> 
> The JDK implementing Format classes, (such as DecimalFormat) leverage the StringBuf proxy methods.
> 
> A corresponding CSR has been drafted: https://bugs.openjdk.org/browse/JDK-8337141, which goes into detail on motivation/history. (Holding off on uploading the specification to CSR until wording finalized).

You should add `@since` tags on all these new API additions.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/20337#issuecomment-2251565706


More information about the i18n-dev mailing list