File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed
spring-core/src/main/java/org/springframework/cglib/core Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -123,13 +123,17 @@ public Predicate getUniqueNamePredicate() {
123
123
}
124
124
125
125
public Object get (AbstractClassGenerator gen , boolean useCache ) {
126
- if (!useCache ) {
127
- return gen .generate (ClassLoaderData .this );
128
- }
129
- else {
126
+ // SPRING PATCH BEGIN
127
+ Object value = null ;
128
+ if (useCache ) {
130
129
Object cachedValue = generatedClasses .get (gen );
131
- return gen .unwrapCachedValue (cachedValue );
130
+ value = gen .unwrapCachedValue (cachedValue );
132
131
}
132
+ if (value == null ) { // fallback when cached WeakReference returns null
133
+ value = gen .generate (ClassLoaderData .this );
134
+ }
135
+ return value ;
136
+ // SPRING PATCH END
133
137
}
134
138
}
135
139
You can’t perform that action at this time.
0 commit comments