-
Notifications
You must be signed in to change notification settings - Fork 38.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support MethodHandle function invocation with varargs array in SpEL
Prior to this commit, the Spring Expression Language (SpEL) could not invoke a varargs MethodHandle function with an array containing the variable arguments, although that is supported for a varargs Method function. Attempting to do so resulted in the array being supplied as a single argument to the MethodHandle. This commit addresses this by updating the executeFunctionViaMethodHandle(...) method in FunctionReference as follows when the user supplies the varargs already packaged in an array. - Creates a new array large enough to hold the non-varargs arguments and the unpackaged varargs arguments. - Adds the non-varargs arguments to the beginning of that array and adds the unpackaged varargs arguments to the end of that array. - Invokes the MethodHandle with the new arguments array. Closes gh-33191
- Loading branch information
Showing
2 changed files
with
31 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters