From d4080e8f226b0ee3c49ffdae15265edb32d4b559 Mon Sep 17 00:00:00 2001 From: Janne Valkealahti Date: Tue, 2 Jan 2024 10:15:22 +0000 Subject: [PATCH] Switch to ApplicationConversionService - ApplicationConversionService extends FormattingConversionService and defines some additional default converters like StringToFileConverter which makes `script` command work under native with given file type option. - Backport #960 - Fixes #964 --- .../shell/boot/SpringShellAutoConfiguration.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/spring-shell-autoconfigure/src/main/java/org/springframework/shell/boot/SpringShellAutoConfiguration.java b/spring-shell-autoconfigure/src/main/java/org/springframework/shell/boot/SpringShellAutoConfiguration.java index 9d97957d..21c47067 100644 --- a/spring-shell-autoconfigure/src/main/java/org/springframework/shell/boot/SpringShellAutoConfiguration.java +++ b/spring-shell-autoconfigure/src/main/java/org/springframework/shell/boot/SpringShellAutoConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2017-2022 the original author or authors. + * Copyright 2017-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -27,7 +27,6 @@ import org.springframework.context.ApplicationContext; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Import; import org.springframework.core.convert.support.DefaultConversionService; -import org.springframework.format.support.FormattingConversionService; import org.springframework.shell.ResultHandler; import org.springframework.shell.ResultHandlerService; import org.springframework.shell.Shell; @@ -48,7 +47,7 @@ public class SpringShellAutoConfiguration { @Bean @ConditionalOnMissingBean public ShellConversionServiceSupplier shellConversionServiceSupplier(ApplicationContext applicationContext) { - FormattingConversionService service = new FormattingConversionService(); + ApplicationConversionService service = new ApplicationConversionService(); DefaultConversionService.addDefaultConverters(service); DefaultConversionService.addCollectionConverters(service); ApplicationConversionService.addBeans(service, applicationContext);