Fix method equality bug in ExtendedBeanInfo
A number of users reported issues with comparing method identity vs equivalence when discovering JavaBeans property methods in ExtendedBeanInfo. This commit updates the implementation to consistently use '.equals()' instead of '=='. Issue: SPR-8079, SPR-8347
This commit is contained in:
@@ -170,8 +170,8 @@ class ExtendedBeanInfo implements BeanInfo {
|
||||
continue ALL_METHODS;
|
||||
}
|
||||
}
|
||||
if (method == pd.getReadMethod()
|
||||
|| (pd instanceof IndexedPropertyDescriptor && method == ((IndexedPropertyDescriptor) pd).getIndexedReadMethod())) {
|
||||
if (method.equals(pd.getReadMethod())
|
||||
|| (pd instanceof IndexedPropertyDescriptor && method.equals(((IndexedPropertyDescriptor) pd).getIndexedReadMethod()))) {
|
||||
// yes -> copy it, including corresponding setter method (if any -- may be null)
|
||||
if (pd instanceof IndexedPropertyDescriptor) {
|
||||
this.addOrUpdatePropertyDescriptor(pd, pd.getName(), pd.getReadMethod(), pd.getWriteMethod(), ((IndexedPropertyDescriptor)pd).getIndexedReadMethod(), ((IndexedPropertyDescriptor)pd).getIndexedWriteMethod());
|
||||
|
||||
Reference in New Issue
Block a user