On Fri, 20 Mar 2026 02:16:26 GMT, Damon Nguyen <[email protected]> wrote:

>> That is because they are swing formatter and extends `DefaultFormatter`. 
>> `DateTimeFormatter `is `java.time` package and doesn;t extend 
>> DefaultFormatter so we need to explicitly create AbstractFormatter so that 
>> getDefaultFormatterFactory returns compatible object
>
> I can see the need to do this. However, it just looks odd when next to the 
> rest. Functionally, I don't see any issues as of now.

I think this deserves at least a named static nested class, which this is not.
Also this needs a specification and a CSR.
see setFormatterFactory(..) which says   
* If you have not explicitly set an <code>AbstractFormatterFactory</code>
     * by way of this method (or a constructor) an
     * <code>AbstractFormatterFactory</code> and consequently an
     * <code>AbstractFormatter</code> will be used based on the
     * <code>Class</code> of the value. <code>NumberFormatter</code> will
     * be used for <code>Number</code>s, <code>DateFormatter</code> will
     * be used for <code>Dates</code>, otherwise <code>DefaultFormatter</code>
     * will be used.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/30292#discussion_r2972142176

Reply via email to