Fixed getCachedExecutor race condition in MethodReference
Issue: SPR-10884
This commit is contained in:
parent
fcd32bc5f5
commit
ed7c8b5a53
|
@ -118,8 +118,7 @@ public class MethodReference extends SpelNodeImpl {
|
||||||
executorToUse = findAccessorForMethod(this.name, argumentTypes, value, evaluationContext);
|
executorToUse = findAccessorForMethod(this.name, argumentTypes, value, evaluationContext);
|
||||||
this.cachedExecutor = new CachedMethodExecutor(executorToUse, targetType, argumentTypes);
|
this.cachedExecutor = new CachedMethodExecutor(executorToUse, targetType, argumentTypes);
|
||||||
try {
|
try {
|
||||||
return executorToUse.execute(evaluationContext,
|
return executorToUse.execute(evaluationContext, value, arguments);
|
||||||
value, arguments);
|
|
||||||
}
|
}
|
||||||
catch (AccessException ex) {
|
catch (AccessException ex) {
|
||||||
// Same unwrapping exception handling as above in above catch block
|
// Same unwrapping exception handling as above in above catch block
|
||||||
|
@ -163,8 +162,9 @@ public class MethodReference extends SpelNodeImpl {
|
||||||
}
|
}
|
||||||
|
|
||||||
private MethodExecutor getCachedExecutor(TypeDescriptor target, List<TypeDescriptor> argumentTypes) {
|
private MethodExecutor getCachedExecutor(TypeDescriptor target, List<TypeDescriptor> argumentTypes) {
|
||||||
if (this.cachedExecutor != null && this.cachedExecutor.isSuitable(target, argumentTypes)) {
|
CachedMethodExecutor executorToCheck = this.cachedExecutor;
|
||||||
return this.cachedExecutor.get();
|
if (executorToCheck != null && executorToCheck.isSuitable(target, argumentTypes)) {
|
||||||
|
return executorToCheck.get();
|
||||||
}
|
}
|
||||||
this.cachedExecutor = null;
|
this.cachedExecutor = null;
|
||||||
return null;
|
return null;
|
||||||
|
@ -249,8 +249,7 @@ public class MethodReference extends SpelNodeImpl {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TypedValue getValue() {
|
public TypedValue getValue() {
|
||||||
return MethodReference.this.getValueInternal(this.evaluationContext,
|
return getValueInternal(this.evaluationContext, this.value, this.arguments, this.targetType);
|
||||||
this.value, this.arguments, this.targetType);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in New Issue