Re: RFR: JDK-8318761: MessageFormat pattern support for CompactNumberFormat, ListFormat, and DateTimeFormatter [v4]

2024-02-08 Thread Justin Lu
On Wed, 7 Feb 2024 15:18:09 GMT, Roger Riggs wrote: >> Would it work with custom implementations for say NumberFormat via the SPI? > > Just moving the if...then... else code to a package-private static method in > the respective XXFormat class would work the same. > I had not thought of an

Re: RFR: JDK-8318761: MessageFormat pattern support for CompactNumberFormat, ListFormat, and DateTimeFormatter [v4]

2024-02-07 Thread Roger Riggs
On Wed, 7 Feb 2024 00:48:30 GMT, Naoto Sato wrote: >> One idea would be to delegate to a (package-private) method in the formatXXX >> class. >> That would localize to the respective class the details. >> (An abstract protected method might be preferred, but its not worth creating >> extra

Re: RFR: JDK-8318761: MessageFormat pattern support for CompactNumberFormat, ListFormat, and DateTimeFormatter [v4]

2024-02-06 Thread Naoto Sato
On Tue, 6 Feb 2024 23:07:49 GMT, Roger Riggs wrote: >> I agree, it was the existing design that caused for example, >> CompactNumberFormat to not automatically be supported by MessageFormat. A >> simple alternative would be storing the potential pre-defined NumberFormats >> in some data

Re: RFR: JDK-8318761: MessageFormat pattern support for CompactNumberFormat, ListFormat, and DateTimeFormatter [v4]

2024-02-06 Thread Roger Riggs
On Tue, 6 Feb 2024 22:31:32 GMT, Justin Lu wrote: >> src/java.base/share/classes/java/text/MessageFormat.java line 681: >> >>> 679: if (fmt instanceof NumberFormat) { >>> 680: // Add any instances returned from the NumberFormat >>> factory methods >>> 681: if

Re: RFR: JDK-8318761: MessageFormat pattern support for CompactNumberFormat, ListFormat, and DateTimeFormatter [v4]

2024-02-06 Thread Justin Lu
On Tue, 6 Feb 2024 14:59:22 GMT, Roger Riggs wrote: >> Justin Lu has updated the pull request incrementally with two additional >> commits since the last revision: >> >> - Apply spacing suggestions >> >>Co-authored-by: Andrey Turbanov >> - add expected message to exception checking

Re: RFR: JDK-8318761: MessageFormat pattern support for CompactNumberFormat, ListFormat, and DateTimeFormatter [v4]

2024-02-06 Thread Roger Riggs
On Fri, 2 Feb 2024 22:24:49 GMT, Naoto Sato wrote: >> We discussed this separately, but will go over again here in case others are >> interested. Since DTF does not implement `equals()`, even if we implement >> `equals()` for the `ClassicFormat`, we would basically still need to >> implement

Re: RFR: JDK-8318761: MessageFormat pattern support for CompactNumberFormat, ListFormat, and DateTimeFormatter [v4]

2024-02-06 Thread Roger Riggs
On Mon, 5 Feb 2024 23:51:00 GMT, Justin Lu wrote: >> Please review this PR and [CSR](https://bugs.openjdk.org/browse/JDK-8319344) >> which adds MessageFormat pattern support for the following subformats: >> ListFormat, CompactNumberFormat, and DateTimeFormatter. This change is >> intended to

Re: RFR: JDK-8318761: MessageFormat pattern support for CompactNumberFormat, ListFormat, and DateTimeFormatter [v4]

2024-02-05 Thread Justin Lu
> Please review this PR and [CSR](https://bugs.openjdk.org/browse/JDK-8319344) > which adds MessageFormat pattern support for the following subformats: > ListFormat, CompactNumberFormat, and DateTimeFormatter. This change is > intended to provide pattern support for the more recently added JDK