From f811ed0b7ca7108f16e57f4e6716ebfc00ba4705 Mon Sep 17 00:00:00 2001 From: Oleg Zhurakousky Date: Tue, 10 Oct 2023 13:12:32 +0200 Subject: [PATCH] Cleanup and dceprecation removal in core --- .../binder/BinderChildContextInitializer.java | 2 +- .../CompositeMessageConverterFactory.java | 19 ------------------- .../function/FunctionConfiguration.java | 4 ++-- 3 files changed, 3 insertions(+), 22 deletions(-) diff --git a/core/spring-cloud-stream/src/main/java/org/springframework/cloud/stream/binder/BinderChildContextInitializer.java b/core/spring-cloud-stream/src/main/java/org/springframework/cloud/stream/binder/BinderChildContextInitializer.java index fe33bd8f7..9b454605d 100644 --- a/core/spring-cloud-stream/src/main/java/org/springframework/cloud/stream/binder/BinderChildContextInitializer.java +++ b/core/spring-cloud-stream/src/main/java/org/springframework/cloud/stream/binder/BinderChildContextInitializer.java @@ -126,7 +126,7 @@ public class BinderChildContextInitializer implements ApplicationContextAware, B * @param childContextInitializers the child context initializers to use * @return copy of this instance that uses the AOT generated child context initializers */ - @SuppressWarnings({"unused", "raw"}) + @SuppressWarnings({"unchecked"}) public BinderChildContextInitializer withChildContextInitializers( Map> childContextInitializers) { this.logger.debug(() -> "Replacing instance w/ one that uses child context initializers"); diff --git a/core/spring-cloud-stream/src/main/java/org/springframework/cloud/stream/converter/CompositeMessageConverterFactory.java b/core/spring-cloud-stream/src/main/java/org/springframework/cloud/stream/converter/CompositeMessageConverterFactory.java index 195fc9dce..6009e96d4 100644 --- a/core/spring-cloud-stream/src/main/java/org/springframework/cloud/stream/converter/CompositeMessageConverterFactory.java +++ b/core/spring-cloud-stream/src/main/java/org/springframework/cloud/stream/converter/CompositeMessageConverterFactory.java @@ -16,7 +16,6 @@ package org.springframework.cloud.stream.converter; -import java.nio.charset.Charset; import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.Collections; @@ -24,7 +23,6 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import com.fasterxml.jackson.core.JsonEncoding; import com.fasterxml.jackson.databind.ObjectMapper; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -131,23 +129,6 @@ public class CompositeMessageConverterFactory { this.converters.add(new ObjectStringMessageConverter()); } - /** - * Determine the JSON encoding to use for the given content type. - * @param contentType the MIME type from the MessageHeaders, if any - * @return the JSON encoding to use (never {@code null}) - */ - private JsonEncoding getJsonEncoding(@Nullable MimeType contentType) { - if (contentType != null && contentType.getCharset() != null) { - Charset charset = contentType.getCharset(); - for (JsonEncoding encoding : JsonEncoding.values()) { - if (charset.name().equals(encoding.getJavaName())) { - return encoding; - } - } - } - return JsonEncoding.UTF8; - } - /** * Creation method. * @param mimeType the target MIME type diff --git a/core/spring-cloud-stream/src/main/java/org/springframework/cloud/stream/function/FunctionConfiguration.java b/core/spring-cloud-stream/src/main/java/org/springframework/cloud/stream/function/FunctionConfiguration.java index f675caa72..b6396b90d 100644 --- a/core/spring-cloud-stream/src/main/java/org/springframework/cloud/stream/function/FunctionConfiguration.java +++ b/core/spring-cloud-stream/src/main/java/org/springframework/cloud/stream/function/FunctionConfiguration.java @@ -252,7 +252,7 @@ public class FunctionConfiguration { return outputName; }).get(); IntegrationFlow postProcessedFlow = (IntegrationFlow) context.getAutowireCapableBeanFactory() - .applyBeanPostProcessorsBeforeInitialization(integrationFlow, integrationFlowName); + .initializeBean(integrationFlow, integrationFlowName); context.registerBean(integrationFlowName, IntegrationFlow.class, () -> postProcessedFlow); } else { @@ -269,7 +269,7 @@ public class FunctionConfiguration { }) .get(); IntegrationFlow postProcessedFlow = (IntegrationFlow) context.getAutowireCapableBeanFactory() - .applyBeanPostProcessorsBeforeInitialization(integrationFlow, integrationFlowName); + .initializeBean(integrationFlow, integrationFlowName); context.registerBean(integrationFlowName, IntegrationFlow.class, () -> postProcessedFlow); } }