Browse Source
The changes made in conjunction with gh-33013 resulted in a regression for varargs support in SpEL expressions. Specifically, before gh-33013 one could supply a list -- for example, an "inline list" -- as the varargs array when invoking a varargs constructor, method, or function within a SpEL expression. However, after gh-33013 an inline list (or collection in general) is no longer converted to an array for varargs invocations. Instead, the list is supplied as a single argument of the resulting varargs array which breaks applications that depend on the previous behavior. Although it was never intended that one could supply a collection as the set of varargs, we concede that this is a regression in existing behavior, and this commit therefore restores support for supplying a java.util.List as the varargs "array". In addition, this commit introduces the same "list to array" conversion support for MethodHandle-based functions that accept varargs. Note, however, that this commit does not restore support for converting arbitrary single objects to an array for varargs invocations if the single object is already an instance of the varargs array's component type. See gh-33013 Closes gh-33315pull/33365/head
3 changed files with 56 additions and 6 deletions
Loading…
Reference in new issue