Remove bean cycles

- Shuffle things around into different auto-config and configuration
  classes and use other tricks like ObjectProvider to work around
  boot 2.6.x imposing bean cycle checks.
- This is first set of changes to work around this issue, not
  to make things perfect. Further refactoring work is needed
  making code base more boot 2.x friendly as things are based
  on boot 1.5.x times.
- Fixes #324
This commit is contained in:
Janne Valkealahti
2021-12-17 15:25:50 +00:00
parent 2de3dd0334
commit e14f4a3f32
19 changed files with 367 additions and 195 deletions

View File

@@ -18,6 +18,7 @@ package org.springframework.shell.samples.standard;
import java.lang.annotation.ElementType;
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
import java.util.stream.Collectors;
@@ -49,7 +50,7 @@ public class Commands {
public String changePassword(@Size(min = 8) String password) {
return "Password changed";
}
@ShellMethod(value = "Shows non trivial character encoding.")
public String helloWorld() {
return "こんにちは世界";
@@ -79,6 +80,18 @@ public class Commands {
public double addDoubles(@ShellOption(arity = 3) double[] numbers) {
return Arrays.stream(numbers).sum();
}
@ShellMethod("Get iterables.")
public Iterable<String> iterables() {
List<String> list = Arrays.asList("first", "second");
Iterable<String> iterable = new Iterable<String>() {
@Override
public Iterator<String> iterator() {
return list.iterator();
}
};
return iterable;
}
}
/**

View File

@@ -1,3 +1,3 @@
spring:
main:
allow-circular-references: true
allow-circular-references: false