On Tue, 6 Feb 2024 23:07:49 GMT, Roger Riggs <rri...@openjdk.org> 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 structure that we could just iterate through to feel less 
>> “whack a mole” like, but that array would still suffer from the same 
>> maintenance issues. I’ll try to think of something better.
>
> 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 public API surface area for this).

Would it work with custom implementations for say NumberFormat via the SPI?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/17663#discussion_r1480743201

Reply via email to