From 62ea627965eb10eb3f3c2b2388ff6d1ac7ddb3a6 Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Wed, 11 Dec 2013 11:58:46 +0100 Subject: [PATCH] Revised exclusion of java.lang.Class properties Issue: SPR-11098 --- .../springframework/beans/CachedIntrospectionResults.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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 10dccab948..44781d9a4a 100644 --- a/spring-beans/src/main/java/org/springframework/beans/CachedIntrospectionResults.java +++ b/spring-beans/src/main/java/org/springframework/beans/CachedIntrospectionResults.java @@ -33,6 +33,7 @@ import java.util.WeakHashMap; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; + import org.springframework.core.convert.TypeDescriptor; import org.springframework.core.io.support.SpringFactoriesLoader; import org.springframework.util.ClassUtils; @@ -265,8 +266,9 @@ public class CachedIntrospectionResults { // This call is slow so we do it once. PropertyDescriptor[] pds = this.beanInfo.getPropertyDescriptors(); for (PropertyDescriptor pd : pds) { - if (Class.class.equals(beanClass) && "classLoader".equals(pd.getName())) { - // Ignore Class.getClassLoader() method - nobody needs to bind to that + if (Class.class.equals(beanClass) && + ("classLoader".equals(pd.getName()) || "protectionDomain".equals(pd.getName()))) { + // Ignore Class.getClassLoader() and getProtectionDomain() methods - nobody needs to bind to those continue; } if (logger.isTraceEnabled()) { -- GitLab