Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
sbrannen opened this issue Aug 5, 2024 · 0 comments
Closed

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

sbrannen opened this issue Aug 5, 2024 · 0 comments
Assignees
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: bug A general bug
Milestone

Comments

@sbrannen
Copy link
Member

sbrannen commented Aug 5, 2024

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

@sbrannen sbrannen added type: bug A general bug in: core Issues in core modules (aop, beans, core, context, expression) labels Aug 5, 2024
@sbrannen sbrannen added this to the 6.1.12 milestone Aug 5, 2024
@sbrannen sbrannen self-assigned this Aug 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: bug A general bug
Projects
None yet
Development

No branches or pull requests

1 participant