From 0cc877ad0fb6dd5775b21b56fc773c577fd2d489 Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Tue, 30 Sep 2014 14:06:43 +0200 Subject: [PATCH] MethodReference accesses cached executor in a thread-safe manner Issue: SPR-12269 --- .../springframework/expression/spel/ast/MethodReference.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-expression/src/main/java/org/springframework/expression/spel/ast/MethodReference.java b/spring-expression/src/main/java/org/springframework/expression/spel/ast/MethodReference.java index f5f62cbfe8..3b40296669 100644 --- a/spring-expression/src/main/java/org/springframework/expression/spel/ast/MethodReference.java +++ b/spring-expression/src/main/java/org/springframework/expression/spel/ast/MethodReference.java @@ -230,7 +230,7 @@ public class MethodReference extends SpelNodeImpl { private void updateExitTypeDescriptor() { CachedMethodExecutor executorToCheck = this.cachedExecutor; - if (executorToCheck.get() instanceof ReflectiveMethodExecutor) { + if (executorToCheck != null && executorToCheck.get() instanceof ReflectiveMethodExecutor) { Method method = ((ReflectiveMethodExecutor) executorToCheck.get()).getMethod(); this.exitTypeDescriptor = CodeFlow.toDescriptor(method.getReturnType()); } -- GitLab