Skip to content

Commit defc1d3

Browse files
committed
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
1 parent 167329c commit defc1d3

File tree

1 file changed

+0
-14
lines changed

1 file changed

+0
-14
lines changed

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

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -289,20 +289,6 @@ private CachedIntrospectionResults(Class<?> beanClass) throws BeansException {
289289
}
290290
this.beanInfo = beanInfo;
291291

292-
// Only bother with flushFromCaches if the Introspector actually cached...
293-
if (!shouldIntrospectorIgnoreBeaninfoClasses) {
294-
// Immediately remove class from Introspector cache, to allow for proper
295-
// garbage collection on class loader shutdown - we cache it here anyway,
296-
// in a GC-friendly manner. In contrast to CachedIntrospectionResults,
297-
// Introspector does not use WeakReferences as values of its WeakHashMap!
298-
Class<?> classToFlush = beanClass;
299-
do {
300-
Introspector.flushFromCaches(classToFlush);
301-
classToFlush = classToFlush.getSuperclass();
302-
}
303-
while (classToFlush != null);
304-
}
305-
306292
if (logger.isTraceEnabled()) {
307293
logger.trace("Caching PropertyDescriptors for class [" + beanClass.getName() + "]");
308294
}

0 commit comments

Comments
 (0)