Browse Source

AccessorLValue reliably downcasts to CompilablePropertyAccessor in concurrent scenarios

Issue: SPR-14850
pull/1223/head
Juergen Hoeller 8 years ago
parent
commit
e2b1dcbaca
  1. 10
      spring-expression/src/main/java/org/springframework/expression/spel/ast/PropertyOrFieldReference.java

10
spring-expression/src/main/java/org/springframework/expression/spel/ast/PropertyOrFieldReference.java

@ -354,10 +354,12 @@ public class PropertyOrFieldReference extends SpelNodeImpl { @@ -354,10 +354,12 @@ public class PropertyOrFieldReference extends SpelNodeImpl {
@Override
public TypedValue getValue() {
TypedValue value = this.ref.getValueInternal(this.contextObject, this.evalContext, this.autoGrowNullReferences);
if (this.ref.cachedReadAccessor instanceof CompilablePropertyAccessor) {
CompilablePropertyAccessor accessor = (CompilablePropertyAccessor) this.ref.cachedReadAccessor;
this.ref.exitTypeDescriptor = CodeFlow.toDescriptor(accessor.getPropertyType());
TypedValue value =
this.ref.getValueInternal(this.contextObject, this.evalContext, this.autoGrowNullReferences);
PropertyAccessor accessorToUse = this.ref.cachedReadAccessor;
if (accessorToUse instanceof CompilablePropertyAccessor) {
this.ref.exitTypeDescriptor =
CodeFlow.toDescriptor(((CompilablePropertyAccessor) accessorToUse).getPropertyType());
}
return value;
}

Loading…
Cancel
Save