You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When trying to upgrade from version 5.1.8 to 5.2.1, our HTTP inbound gateway started throwing NPEs when evaluating header functions. Our code is quite basic:
IntegrationFlows.from(
inboundGateway( gatewayPath )
.headerFunction(SOME_HEADER, ent -> getSomeHeaderValue(ent ) ) // ent is null
Seems to be related to the call FunctionExpression.getValue(...) which ignores EvaluationContext.getRootObject()
Do you need more info on this?
The text was updated successfully, but these errors were encountered:
Where it calls an Expression.getValue(EvaluationContext context, Object rootObject, @Nullable Class<T> desiredResultType) with null for rootObject.
This is not what we should call according SpEL contract. So, the fix must be done in the ExpressionEvalMap.
Although FunctionExpression may be effected with some refactoring as well.
Fixesspring-projects#3114
The contract of SpEL with its
`getValue(EvaluationContext context, @nullable Object rootObject)` is
that we need to deal with provided `rootObject` even if it is `null`
and don't consult with `context.getRootObject()`
* Fix `ExpressionEvalMap` to have an internal `rootExplicitlySet`
to indicate that `root` explicitly provided by consumer, even if it is null.
According this flag call respective `Expression.getValue()`
* Add `@Nullable` to methods and their arguments into `ExpressionEvalMap`
& `FunctionExpression` to honor `Expression` contracts
* Populate an `HttpEntity` explicitly into `ExpressionEvalMap` from the
`HttpRequestHandlingEndpointSupport` and `WebFluxInboundEndpoint` for
full picture
When trying to upgrade from version 5.1.8 to 5.2.1, our HTTP inbound gateway started throwing NPEs when evaluating header functions. Our code is quite basic:
Seems to be related to the call
FunctionExpression.getValue(...)
which ignoresEvaluationContext.getRootObject()
Do you need more info on this?
The text was updated successfully, but these errors were encountered: