Skip to content

SpEL cannot invoke varargs MethodHandle function with an array #33191

Closed
@sbrannen

Description

@sbrannen

The Spring Expression Language (SpEL) currently cannot invoke a varargs MethodHandle function with an array, although that is supported for a varargs Method function.

Attempting to do so results in the array being supplied as a single argument to the MethodHandle.

For example, given a MethodHandle registered as a function named format that accepts (String, Object...), the SpEL expression #format('x', 'a', 'z') is supported, but the expression #format('x', new Object[]{'a', 'z'}) fails to evaluate since the MethodHandle is invoked with ('x', ['a', 'z']) whereas ('x', 'a', 'z') is required for a MethodHandle invocation.

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)type: bugA general bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions