Remove deprecated property

This commit is contained in:
Oleg Zhurakousky
2022-07-27 12:52:51 +02:00
parent 5c6c0eddcb
commit ff83f3bc59
2 changed files with 3 additions and 11 deletions

View File

@@ -85,9 +85,6 @@ import org.springframework.util.StringUtils;
@AutoConfigureAfter(name = {"org.springframework.cloud.function.deployer.FunctionDeployerConfiguration"})
public class ContextFunctionCatalogAutoConfiguration {
@Deprecated
static final String PREFERRED_MAPPER_PROPERTY = "spring.http.converters.preferred-json-mapper";
/**
* The name of the property to specify desired JSON mapper. Available values are `jackson' and 'gson'.
*/
@@ -194,9 +191,7 @@ public class ContextFunctionCatalogAutoConfiguration {
public static class JsonMapperConfiguration {
@Bean
public JsonMapper jsonMapper(ApplicationContext context) {
String preferredMapper = context.getEnvironment().containsProperty(JSON_MAPPER_PROPERTY)
? context.getEnvironment().getProperty(JSON_MAPPER_PROPERTY)
: context.getEnvironment().getProperty(PREFERRED_MAPPER_PROPERTY);
String preferredMapper = context.getEnvironment().getProperty(JSON_MAPPER_PROPERTY);
if (StringUtils.hasText(preferredMapper)) {
if ("gson".equals(preferredMapper) && ClassUtils.isPresent("com.google.gson.Gson", null)) {
return gson(context);

View File

@@ -134,11 +134,8 @@ public class ContextFunctionCatalogInitializer implements ApplicationContextInit
}
ConfigurationPropertiesBindingPostProcessor.register(registry);
String preferredMapper = context.getEnvironment().containsProperty(ContextFunctionCatalogAutoConfiguration.JSON_MAPPER_PROPERTY)
? context.getEnvironment().getProperty(ContextFunctionCatalogAutoConfiguration.JSON_MAPPER_PROPERTY)
: context.getEnvironment().getProperty(ContextFunctionCatalogAutoConfiguration.PREFERRED_MAPPER_PROPERTY);
String preferredMapper = context.getEnvironment().getProperty(ContextFunctionCatalogAutoConfiguration.JSON_MAPPER_PROPERTY);
if (ClassUtils.isPresent("com.google.gson.Gson", null) && "gson".equals(preferredMapper)) {
if (this.context.getBeanFactory().getBeanNamesForType(Gson.class, false, false).length == 0) {
this.context.registerBean(Gson.class, () -> new Gson());