File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed
spring-integration-core/src/main/java/org/springframework/integration/config
spring-integration-http/src/main/java/org/springframework/integration/http/support Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -59,8 +59,8 @@ public void setApplicationContext(ApplicationContext applicationContext) throws
5959 @ Override
6060 public void afterPropertiesSet () {
6161 ConversionService conversionService = IntegrationUtils .getConversionService (this .applicationContext );
62- if (conversionService instanceof GenericConversionService ) {
63- registerConverters (( GenericConversionService ) conversionService );
62+ if (conversionService instanceof GenericConversionService genericConversionService ) {
63+ registerConverters (genericConversionService );
6464 }
6565 else {
6666 Assert .notNull (conversionService ,
Original file line number Diff line number Diff line change 4747import org .springframework .beans .factory .InitializingBean ;
4848import org .springframework .core .convert .ConversionService ;
4949import org .springframework .core .convert .TypeDescriptor ;
50+ import org .springframework .core .convert .support .DefaultConversionService ;
5051import org .springframework .http .HttpHeaders ;
5152import org .springframework .http .HttpMethod ;
5253import org .springframework .http .MediaType ;
@@ -336,15 +337,19 @@ public void setExcludedInboundStandardResponseHeaderNames(String... excludedInbo
336337 /**
337338 * Sets the prefix to use with user-defined (non-standard) headers. The default is an
338339 * empty string.
339- * @param userDefinedHeaderPrefix The user defined header prefix.
340+ * @param userDefinedHeaderPrefix The user defined the header prefix.
340341 */
341342 public void setUserDefinedHeaderPrefix (@ Nullable String userDefinedHeaderPrefix ) {
342343 this .userDefinedHeaderPrefix = (userDefinedHeaderPrefix != null ) ? userDefinedHeaderPrefix : "" ;
343344 }
344345
345346 @ Override
346347 public void afterPropertiesSet () {
347- this .conversionService = IntegrationUtils .getConversionService (this .beanFactory );
348+ ConversionService conversionServiceToUse = IntegrationUtils .getConversionService (this .beanFactory );
349+ if (conversionServiceToUse == null ) {
350+ conversionServiceToUse = DefaultConversionService .getSharedInstance ();
351+ }
352+ this .conversionService = conversionServiceToUse ;
348353 }
349354
350355 /**
You can’t perform that action at this time.
0 commit comments