Skip to content

Commit 62ea627

Browse files
committed
Revised exclusion of java.lang.Class properties
Issue: SPR-11098
1 parent a1529d4 commit 62ea627

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

spring-beans/src/main/java/org/springframework/beans/CachedIntrospectionResults.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333

3434
import org.apache.commons.logging.Log;
3535
import org.apache.commons.logging.LogFactory;
36+
3637
import org.springframework.core.convert.TypeDescriptor;
3738
import org.springframework.core.io.support.SpringFactoriesLoader;
3839
import org.springframework.util.ClassUtils;
@@ -265,8 +266,9 @@ private CachedIntrospectionResults(Class<?> beanClass) throws BeansException {
265266
// This call is slow so we do it once.
266267
PropertyDescriptor[] pds = this.beanInfo.getPropertyDescriptors();
267268
for (PropertyDescriptor pd : pds) {
268-
if (Class.class.equals(beanClass) && "classLoader".equals(pd.getName())) {
269-
// Ignore Class.getClassLoader() method - nobody needs to bind to that
269+
if (Class.class.equals(beanClass) &&
270+
("classLoader".equals(pd.getName()) || "protectionDomain".equals(pd.getName()))) {
271+
// Ignore Class.getClassLoader() and getProtectionDomain() methods - nobody needs to bind to those
270272
continue;
271273
}
272274
if (logger.isTraceEnabled()) {

0 commit comments

Comments
 (0)