All branches in a conditional structure should not have exactly the same implementation

This commit is contained in:
igor-suhorukov
2018-03-30 00:14:37 +03:00
committed by Juergen Hoeller
parent ab96bb5428
commit 93abe0e94b
5 changed files with 6 additions and 23 deletions

View File

@@ -285,11 +285,7 @@ public class MutablePropertyValues implements PropertyValues, Serializable {
for (PropertyValue newPv : this.propertyValueList) {
// if there wasn't an old one, add it
PropertyValue pvOld = old.getPropertyValue(newPv.getName());
if (pvOld == null) {
changes.addPropertyValue(newPv);
}
else if (!pvOld.equals(newPv)) {
// it's changed
if (pvOld == null || !pvOld.equals(newPv)) {
changes.addPropertyValue(newPv);
}
}

View File

@@ -409,12 +409,7 @@ public class GroovyBeanDefinitionReader extends AbstractBeanDefinitionReader imp
}
private boolean addDeferredProperty(String property, Object newValue) {
if (newValue instanceof List) {
this.deferredProperties.put(this.currentBeanDefinition.getBeanName() + '.' + property,
new DeferredProperty(this.currentBeanDefinition, property, newValue));
return true;
}
else if (newValue instanceof Map) {
if (newValue instanceof List || newValue instanceof Map) {
this.deferredProperties.put(this.currentBeanDefinition.getBeanName() + '.' + property,
new DeferredProperty(this.currentBeanDefinition, property, newValue));
return true;