Skip to content

SpEL wraps primitive array in Object[] when invoking varargs method #33317

Closed
@sbrannen

Description

@sbrannen

Overview

When invoking a varargs method, instead of converting a primitive array to an Object[], the Spring Expression Language (SpEL) incorrectly wraps the primitive array in an Object[].

For example, given a format(Object...) method in a registered #model variable and the expression #model.format(new int[]{1, 2, 3}), the format() method is currently invoked as format(new Object[new int[]{1, 2, 3}]) instead of format(new Object[]{1, 2, 3}).

This is closely related to #33198; however, this issue is specific to varargs method/constructor invocations and not related to MethodHandle invocations for registered functions.

Related Issues

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