Browse Source

Remove unnecessary fallback to DefaultConversionService

See gh-34936
pull/35405/head
Juergen Hoeller 7 months ago
parent
commit
d9c103b7ff
  1. 7
      spring-context/src/main/java/org/springframework/context/support/PropertySourcesPlaceholderConfigurer.java

7
spring-context/src/main/java/org/springframework/context/support/PropertySourcesPlaceholderConfigurer.java

@ -25,7 +25,6 @@ import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
import org.springframework.beans.factory.config.PlaceholderConfigurerSupport; import org.springframework.beans.factory.config.PlaceholderConfigurerSupport;
import org.springframework.context.EnvironmentAware; import org.springframework.context.EnvironmentAware;
import org.springframework.core.convert.ConversionService; import org.springframework.core.convert.ConversionService;
import org.springframework.core.convert.support.DefaultConversionService;
import org.springframework.core.env.ConfigurableEnvironment; import org.springframework.core.env.ConfigurableEnvironment;
import org.springframework.core.env.ConfigurablePropertyResolver; import org.springframework.core.env.ConfigurablePropertyResolver;
import org.springframework.core.env.Environment; import org.springframework.core.env.Environment;
@ -270,11 +269,7 @@ public class PropertySourcesPlaceholderConfigurer extends PlaceholderConfigurerS
if (value instanceof String string) { if (value instanceof String string) {
return string; return string;
} }
ConversionService conversionService = super.source.getConversionService(); return super.source.getConversionService().convert(value, String.class);
if (conversionService == null) {
conversionService = DefaultConversionService.getSharedInstance();
}
return conversionService.convert(value, String.class);
} }
@Override @Override

Loading…
Cancel
Save