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
59
59
@ Override
60
60
public void afterPropertiesSet () {
61
61
ConversionService conversionService = IntegrationUtils .getConversionService (this .applicationContext );
62
- if (conversionService instanceof GenericConversionService ) {
63
- registerConverters (( GenericConversionService ) conversionService );
62
+ if (conversionService instanceof GenericConversionService genericConversionService ) {
63
+ registerConverters (genericConversionService );
64
64
}
65
65
else {
66
66
Assert .notNull (conversionService ,
Original file line number Diff line number Diff line change 47
47
import org .springframework .beans .factory .InitializingBean ;
48
48
import org .springframework .core .convert .ConversionService ;
49
49
import org .springframework .core .convert .TypeDescriptor ;
50
+ import org .springframework .core .convert .support .DefaultConversionService ;
50
51
import org .springframework .http .HttpHeaders ;
51
52
import org .springframework .http .HttpMethod ;
52
53
import org .springframework .http .MediaType ;
@@ -336,15 +337,19 @@ public void setExcludedInboundStandardResponseHeaderNames(String... excludedInbo
336
337
/**
337
338
* Sets the prefix to use with user-defined (non-standard) headers. The default is an
338
339
* empty string.
339
- * @param userDefinedHeaderPrefix The user defined header prefix.
340
+ * @param userDefinedHeaderPrefix The user defined the header prefix.
340
341
*/
341
342
public void setUserDefinedHeaderPrefix (@ Nullable String userDefinedHeaderPrefix ) {
342
343
this .userDefinedHeaderPrefix = (userDefinedHeaderPrefix != null ) ? userDefinedHeaderPrefix : "" ;
343
344
}
344
345
345
346
@ Override
346
347
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 ;
348
353
}
349
354
350
355
/**
You can’t perform that action at this time.
0 commit comments