Skip to content

Commit

Permalink
Switch to ApplicationConversionService
Browse files Browse the repository at this point in the history
- ApplicationConversionService extends FormattingConversionService
  and defines some additional default converters like
  StringToFileConverter which makes `script` command work
  under native with given file type option.
- Fixes #960
  • Loading branch information
jvalkeal committed Jan 2, 2024
1 parent 51f49f7 commit 2fdd45a
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -27,7 +27,6 @@
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;
Expand All @@ -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);
Expand Down

0 comments on commit 2fdd45a

Please sign in to comment.