Skip to content

Commit f27b949

Browse files
committed
CachedIntrospectionResults uses SoftReference instead of WeakReference for non-cache-safe entries
Issue: SPR-11867
1 parent e9ecaf6 commit f27b949

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;
@@ -196,7 +196,7 @@ static CachedIntrospectionResults forClass(Class<?> beanClass) throws BeansExcep
196196
}
197197
results = new CachedIntrospectionResults(beanClass);
198198
synchronized (classCache) {
199-
classCache.put(beanClass, new WeakReference<CachedIntrospectionResults>(results));
199+
classCache.put(beanClass, new SoftReference<CachedIntrospectionResults>(results));
200200
}
201201
}
202202
}

0 commit comments

Comments
 (0)