Skip to content

Commit 8307447

Browse files
committed
CachedIntrospectionResults uses SoftReference instead of WeakReference for non-cache-safe entries
Issue: SPR-11867 (cherry picked from commit f27b949)
1 parent 983cce2 commit 8307447

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
import java.beans.Introspector;
2222
import java.beans.PropertyDescriptor;
2323
import java.lang.ref.Reference;
24-
import java.lang.ref.WeakReference;
24+
import java.lang.ref.SoftReference;
2525
import java.util.HashSet;
2626
import java.util.Iterator;
2727
import java.util.LinkedHashMap;
@@ -194,7 +194,7 @@ static CachedIntrospectionResults forClass(Class<?> beanClass) throws BeansExcep
194194
}
195195
results = new CachedIntrospectionResults(beanClass);
196196
synchronized (classCache) {
197-
classCache.put(beanClass, new WeakReference<CachedIntrospectionResults>(results));
197+
classCache.put(beanClass, new SoftReference<CachedIntrospectionResults>(results));
198198
}
199199
}
200200
}

0 commit comments

Comments
 (0)