I really don't like this in any way.
该提问来源于开源项目:openzipkin/brave
I really don't like this in any way.
该提问来源于开源项目:openzipkin/brave
here's the problem that can sneak up on the next change to add a list parameter.
java
static class ListBindingProblems {
List<a> as;
List<b> bs;
A provideA() {
return new AB();
}
}
public void listBindingProblems() {
context.register(ListBindingProblems.class);
context.refresh();
ListBindingProblems problems = context.getBean(ListBindingProblems.class);
assertThat(problems.as).hasSize(1);
// eventhough the user declared their bean method provideA as returning A, spring will look at
// all types and magically fill here. What that means is you have to be defensive about dupes,
// or make it impossible to create dupes by type hierarchy.
assertThat(problems.bs).hasSize(1);
}
</b></a>