From defc1d31574ea6b3faa5ed84c4aa23c808b0c7cf Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Fri, 24 Jan 2014 18:22:11 +0100 Subject: [PATCH] Drop Introspector.flushFromCaches calls completely According to the JDK's documentation and changelog, the Introspector itself safely handles weak references as of JDK 6 update 21 (which is what we require for Spring 4.0). Issue: SPR-11356 --- .../beans/CachedIntrospectionResults.java | 14 -------------- 1 file changed, 14 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 c71cd4e138..94cb286d10 100644 --- a/spring-beans/src/main/java/org/springframework/beans/CachedIntrospectionResults.java +++ b/spring-beans/src/main/java/org/springframework/beans/CachedIntrospectionResults.java @@ -289,20 +289,6 @@ public class CachedIntrospectionResults { } this.beanInfo = beanInfo; - // Only bother with flushFromCaches if the Introspector actually cached... - if (!shouldIntrospectorIgnoreBeaninfoClasses) { - // Immediately remove class from Introspector cache, to allow for proper - // garbage collection on class loader shutdown - we cache it here anyway, - // in a GC-friendly manner. In contrast to CachedIntrospectionResults, - // Introspector does not use WeakReferences as values of its WeakHashMap! - Class classToFlush = beanClass; - do { - Introspector.flushFromCaches(classToFlush); - classToFlush = classToFlush.getSuperclass(); - } - while (classToFlush != null); - } - if (logger.isTraceEnabled()) { logger.trace("Caching PropertyDescriptors for class [" + beanClass.getName() + "]"); }