[SPR-6063] fixed issue with inconsistent views of PropertyDescriptors
This commit is contained in:
@@ -338,7 +338,7 @@ public abstract class BeanUtils {
|
||||
*/
|
||||
public static PropertyDescriptor[] getPropertyDescriptors(Class<?> clazz) throws BeansException {
|
||||
CachedIntrospectionResults cr = CachedIntrospectionResults.forClass(clazz);
|
||||
return cr.getBeanInfo().getPropertyDescriptors();
|
||||
return cr.getPropertyDescriptors();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -275,7 +275,7 @@ public class BeanWrapperImpl extends AbstractPropertyAccessor implements BeanWra
|
||||
|
||||
|
||||
public PropertyDescriptor[] getPropertyDescriptors() {
|
||||
return getCachedIntrospectionResults().getBeanInfo().getPropertyDescriptors();
|
||||
return getCachedIntrospectionResults().getPropertyDescriptors();
|
||||
}
|
||||
|
||||
public PropertyDescriptor getPropertyDescriptor(String propertyName) throws BeansException {
|
||||
|
||||
@@ -29,6 +29,7 @@ import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.WeakHashMap;
|
||||
import java.util.Collection;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
@@ -268,4 +269,9 @@ public class CachedIntrospectionResults {
|
||||
return this.propertyDescriptorCache.get(propertyName);
|
||||
}
|
||||
|
||||
PropertyDescriptor[] getPropertyDescriptors() {
|
||||
Collection<PropertyDescriptor> descriptorCollection = this.propertyDescriptorCache.values();
|
||||
return descriptorCollection.toArray(new PropertyDescriptor[descriptorCollection.size()]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user