Polishing

This commit is contained in:
Juergen Hoeller
2018-02-25 00:48:00 +01:00
parent 57a9e8e6dd
commit 295df21f06
7 changed files with 30 additions and 37 deletions

View File

@@ -419,7 +419,7 @@ public class DefaultListableBeanFactory extends AbstractAutowireCapableBeanFacto
RootBeanDefinition mbd = getMergedLocalBeanDefinition(beanName);
// Only check bean definition if it is complete.
if (!mbd.isAbstract() && (allowEagerInit ||
((mbd.hasBeanClass() || !mbd.isLazyInit() || isAllowEagerClassLoading())) &&
(mbd.hasBeanClass() || !mbd.isLazyInit() || isAllowEagerClassLoading()) &&
!requiresEagerInitForType(mbd.getFactoryBeanName()))) {
// In case of FactoryBean, match object created by FactoryBean.
boolean isFactoryBean = isFactoryBean(beanName, mbd);

View File

@@ -402,8 +402,8 @@ public class BeanDefinitionParserDelegate {
public BeanDefinitionDefaults getBeanDefinitionDefaults() {
BeanDefinitionDefaults bdd = new BeanDefinitionDefaults();
bdd.setLazyInit("TRUE".equalsIgnoreCase(this.defaults.getLazyInit()));
bdd.setDependencyCheck(this.getDependencyCheck(DEFAULT_VALUE));
bdd.setAutowireMode(this.getAutowireMode(DEFAULT_VALUE));
bdd.setDependencyCheck(getDependencyCheck(DEFAULT_VALUE));
bdd.setAutowireMode(getAutowireMode(DEFAULT_VALUE));
bdd.setInitMethodName(this.defaults.getInitMethod());
bdd.setDestroyMethodName(this.defaults.getDestroyMethod());
return bdd;
@@ -1255,7 +1255,7 @@ public class BeanDefinitionParserDelegate {
boolean hasKeyAttribute = entryEle.hasAttribute(KEY_ATTRIBUTE);
boolean hasKeyRefAttribute = entryEle.hasAttribute(KEY_REF_ATTRIBUTE);
if ((hasKeyAttribute && hasKeyRefAttribute) ||
((hasKeyAttribute || hasKeyRefAttribute)) && keyEle != null) {
(hasKeyAttribute || hasKeyRefAttribute) && keyEle != null) {
error("<entry> element is only allowed to contain either " +
"a 'key' attribute OR a 'key-ref' attribute OR a <key> sub-element", entryEle);
}
@@ -1284,7 +1284,7 @@ public class BeanDefinitionParserDelegate {
boolean hasValueRefAttribute = entryEle.hasAttribute(VALUE_REF_ATTRIBUTE);
boolean hasValueTypeAttribute = entryEle.hasAttribute(VALUE_TYPE_ATTRIBUTE);
if ((hasValueAttribute && hasValueRefAttribute) ||
((hasValueAttribute || hasValueRefAttribute)) && valueEle != null) {
(hasValueAttribute || hasValueRefAttribute) && valueEle != null) {
error("<entry> element is only allowed to contain either " +
"'value' attribute OR 'value-ref' attribute OR <value> sub-element", entryEle);
}