Also add tests to cover qualifier classes.
Comment From: liuao1004
Hi, I think the code is not redundant. You will be right if someone use the method registerBean
in AnnotatedBeanDefinitionReader
without providing qualifiers.
In fact, the fixed true
is just the defalut value for @Lazy
or @Primray
.
StaticApplicationContext context = new StaticApplicationContext();
AnnotatedBeanDefinitionReader reader = new AnnotatedBeanDefinitionReader(context);
reader.registerBean(User.class, "user", Lazy.class);
BeanDefinition definition = context.getBeanDefinition("user");
// must be true
assert definition.isLazyInit();
Comment From: quaff
Hi, I think the code is not redundant. You will be right if someone use the method
registerBean
inAnnotatedBeanDefinitionReader
without providing qualifiers. In fact, the fixedtrue
is just the defalut value for@Lazy
or@Primray
.
StaticApplicationContext context = new StaticApplicationContext(); AnnotatedBeanDefinitionReader reader = new AnnotatedBeanDefinitionReader(context); reader.registerBean(User.class, "user", Lazy.class); BeanDefinition definition = context.getBeanDefinition("user"); // must be true assert definition.isLazyInit();
Thanks for point out, It seems not covered by tests, I will add tests instead.
Comment From: jhoeller
@quaff this looks good to me. Just one glitch: AnnotatedBeanDefinitionReaderTests
seems to be defined in a file named AnnotationBeanDefinitionReaderTests
, or am I misreading this?
Comment From: quaff
@quaff this looks good to me. Just one glitch:
AnnotatedBeanDefinitionReaderTests
seems to be defined in a file namedAnnotationBeanDefinitionReaderTests
, or am I misreading this?
My mistake, fixed now.