diff --git a/spring-beans/src/main/java/org/springframework/beans/CachedIntrospectionResults.java b/spring-beans/src/main/java/org/springframework/beans/CachedIntrospectionResults.java index eaf54e862a..ef74f0dd37 100644 --- a/spring-beans/src/main/java/org/springframework/beans/CachedIntrospectionResults.java +++ b/spring-beans/src/main/java/org/springframework/beans/CachedIntrospectionResults.java @@ -247,20 +247,17 @@ public class CachedIntrospectionResults { /** * Retrieve a {@link BeanInfo} descriptor for the given target class. * @param beanClass the target class to introspect - * @param ignoreBeaninfoClasses whether to apply {@link Introspector#IGNORE_ALL_BEANINFO} mode * @return the resulting {@code BeanInfo} descriptor (never {@code null}) * @throws IntrospectionException from the underlying {@link Introspector} */ - private static BeanInfo getBeanInfo(Class beanClass, boolean ignoreBeaninfoClasses) - throws IntrospectionException { - + private static BeanInfo getBeanInfo(Class beanClass) throws IntrospectionException { for (BeanInfoFactory beanInfoFactory : beanInfoFactories) { BeanInfo beanInfo = beanInfoFactory.getBeanInfo(beanClass); if (beanInfo != null) { return beanInfo; } } - return (ignoreBeaninfoClasses ? + return (shouldIntrospectorIgnoreBeaninfoClasses ? Introspector.getBeanInfo(beanClass, Introspector.IGNORE_ALL_BEANINFO) : Introspector.getBeanInfo(beanClass)); } @@ -286,7 +283,7 @@ public class CachedIntrospectionResults { if (logger.isTraceEnabled()) { logger.trace("Getting BeanInfo for class [" + beanClass.getName() + "]"); } - this.beanInfo = getBeanInfo(beanClass, shouldIntrospectorIgnoreBeaninfoClasses); + this.beanInfo = getBeanInfo(beanClass); if (logger.isTraceEnabled()) { logger.trace("Caching PropertyDescriptors for class [" + beanClass.getName() + "]"); @@ -318,9 +315,7 @@ public class CachedIntrospectionResults { Class[] ifcs = clazz.getInterfaces(); for (Class ifc : ifcs) { if (!ClassUtils.isJavaLanguageInterface(ifc)) { - BeanInfo ifcInfo = getBeanInfo(ifc, true); - PropertyDescriptor[] ifcPds = ifcInfo.getPropertyDescriptors(); - for (PropertyDescriptor pd : ifcPds) { + for (PropertyDescriptor pd : getBeanInfo(ifc).getPropertyDescriptors()) { if (!this.propertyDescriptorCache.containsKey(pd.getName())) { pd = buildGenericTypeAwarePropertyDescriptor(beanClass, pd); this.propertyDescriptorCache.put(pd.getName(), pd);