While debugging WebConversionService initialization, I noticed that DateFormatterRegistrar.addDateConverters(...) appears to be invoked twice during the setup of the default formatting conversion service.
The call path is:
DefaultFormattingConversionService.addDefaultFormatters(FormatterRegistry formatterRegistry)
├─ new DateTimeFormatterRegistrar().registerFormatters(formatterRegistry)
│ └─ DateTimeConverters.registerConverters(registry)
│ └─ DateFormatterRegistrar.addDateConverters(registry)
└─ new DateFormatterRegistrar().registerFormatters(formatterRegistry)
└─ addDateConverters(registry)
As a result, the following converters are registered twice:
DateToLongConverter
DateToCalendarConverter
CalendarToDateConverter
CalendarToLongConverter
LongToDateConverter
LongToCalendarConverter
When inspecting the internal converter registry, I can see duplicate converter instances for the same source/target type pairs.
I understand that this does not appear to cause any functional issues, since conversion behavior remains unchanged. However, the duplicate registrations seem redundant and may introduce unnecessary converter instances in the registry.
I may be missing some historical context here, but I wanted to check whether this duplication is expected or if it could be simplified.
While debugging
WebConversionServiceinitialization, I noticed thatDateFormatterRegistrar.addDateConverters(...)appears to be invoked twice during the setup of the default formatting conversion service.The call path is:
As a result, the following converters are registered twice:
DateToLongConverterDateToCalendarConverterCalendarToDateConverterCalendarToLongConverterLongToDateConverterLongToCalendarConverterWhen inspecting the internal converter registry, I can see duplicate converter instances for the same source/target type pairs.
I understand that this does not appear to cause any functional issues, since conversion behavior remains unchanged. However, the duplicate registrations seem redundant and may introduce unnecessary converter instances in the registry.
I may be missing some historical context here, but I wanted to check whether this duplication is expected or if it could be simplified.