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:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
spring:
|
||||
main:
|
||||
allow-circular-references: true
|
||||
allow-circular-references: false
|
||||
Reference in New Issue
Block a user