-
Notifications
You must be signed in to change notification settings - Fork 38.5k
Allow auto grow for entries without default constructor in SpEL #25367
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
Conversation
@aclement, would you mind taking a quick look at this to assess the implementation within the context of SpEL? |
I think I'm ok with that change. Might be worth a line in the section in the docs around |
Thanks for the quick review, @aclement. Much appreciated!
@HorseD, would you mind adding such documentation to the reference manual ( |
Hey, I added a note to the reference manual plus one more unit test. Have a good day! |
Thanks
You, too! |
Hi,
I wanted to add a
BigDecimal
to a list using SpEL. Auto grow only works for element types with a default constructor and sinceBigDecimal
does not have a default constructor auto grow does not work with my list.Here is an example:
Changing the first entry passes but adding an entry fails with
My solution inserts
null
when no default constructor can be found for the element type. Not sure if this is a good solution but at least it does not seem to break any tests. Please be nice :-)