On Fri, 20 Mar 2026 01:26:15 GMT, Prasanta Sadhukhan <[email protected]> 
wrote:

>> src/java.desktop/share/classes/javax/swing/JFormattedTextField.java line 900:
>> 
>>> 898:             };
>>> 899:             return new DefaultFormatterFactory(abstractFormatter);
>>> 900:         }
>> 
>> I noticed each other instance type has its own formatter class (ex: Date & 
>> DateFormatter). Should `stringToValue` and `valueToString` be elsewhere? I 
>> suppose it's functionally fine here, but it doesn't seem to follow the rest 
>> of the types.
>
> 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.

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

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

Reply via email to