SingletonSupplier is introduced since 5.1, we could reuse this to create singleton such as DefaultConversionService
for example
private static SingletonSupplier<DefaultConversionService> singletonSupplier = SingletonSupplier
.of(DefaultConversionService::new);
public static DefaultConversionService getSharedInstance() {
return singletonSupplier.obtain();
}
Comment From: quaff
Superseded by https://github.com/spring-projects/spring-framework/pull/24303