Browse Source

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
pull/452/head
Juergen Hoeller 12 years ago
parent
commit
defc1d3157
  1. 14
      spring-beans/src/main/java/org/springframework/beans/CachedIntrospectionResults.java

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

@ -289,20 +289,6 @@ public class CachedIntrospectionResults { @@ -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() + "]");
}

Loading…
Cancel
Save