When a node of an SPeL expression was a call to a bean referenced
in a method argument, the expression was resolved twice.
The resolved arguments are now specified to MethodValueRef instead
of resolving the arguments again in the constructor
Issue: SPR-11445
(cherry picked from commit 519799e)
Fix regression introduced in b25e91a5 where ReflectivePropertyAccessor
does not consider the return type for "is" getters.
Issue: SPR-11142
(cherry picked from commit 85b0bfff)
Relax the method search algorithm used by `ReflectivePropertyAccessor`
to include methods of the form `getXY()` for properties of the form
`xy`.
Although the JavaBean specification indicates that a property `xy`
should use the accessors `getxY()` and `setxY()`, in practice many
developers choose to have an uppercase first character. The
`ReflectivePropertyAccessor` will now consider these style methods if
the traditional conventions fail to find a match.
Issue: SPR-10716
(cherry picked from commit b25e91a5)
Update the `CacheKey` class used by `ReflectivePropertyAccessor` to
include if the target object is class. The prevents an incorrect cache
hit from being returned when a property with the same name is read on
both an object and its class. For example:
#{class.name}
#{name}
Issue: SPR-10486
(cherry picked from commit 6d882b14)
Update getValue(EvaluationContext context, Object rootObject,
Class<T> desiredResultType) to propagate the EvaluationContext to
ExpressionUtils.
Issue: SPR-10953
(cherry picked from 686cd79)
Replace "Problem locating method {0} cannot on type {1}" with
"Problem locating method {0} on type {1}".
Issue: SPR-10928
(cherry picked from 824ac5)
Conflicts:
spring-expression/src/main/java/org/springframework/expression/spel/SpelMessage.java
This commit includes a full backport of the changes in SPR-10657, instead of just the initial commit which the original backport request referred to.
Issue: SPR-10884
Issue: SPR-10657
Update the cached MethodExecutor in MethodReference to include the
method argument types. Prevents the incorrect use of the cache when the
SpEL expression refers to a class that has overloaded methods.
Issue: SPR-10657
(cherry picked from commit f9b12b8)
Use LinkedHashMaps/Sets wherever exposed to users, and code tests defensively in terms of expected Map/Set ordering. Otherwise, there'll be runtime order differences between JDK 7 and JDK 8 due to internal HashMap/Set implementation differences.
Issue: SPR-9639
(cherry picked from commit 9c09a0a)
Provide an additional constructor on SpelParserConfiguration that can
be used to limit the maximum size that a collection will auto grow when
being accessed via a SpEL expression.
This constraint is particularly useful when SpEL is used with data
binding as it prevents a malicious user from crafting a request that
causes OutOfMemory exceptions.
Issue: SPR-10229