See line 1198: ObjectUtils.nullSafeEquals(this.propertyValues, that.propertyValues) Look at AbstractBeanDefinition#getPropertyValues, line 891, which treats, in effect a propertyValues of null as equivalent to en empty MutablePropertyValues object (i.e., a side-effect of getPropertyValues is to create an empty MutablePropertyValues object when propertyValues is null). Affects version 5.3.3
Comment From: jhoeller
This turns out to be a regression from 4.3.x where there always were empty MutablePropertyValues
and ConstructorArgumentValues
instances in every BeanDefinition
. In 5.x we optimized those to be lazily created but accidentally consider BeanDefinition
instances non-equal now if they are not in the same field initialization state, even if nothing has been registered.
Comment From: AnthonyYeracaris
BTW, and forgive me if it's too obvious, but don't forget the hashCode() implementation.