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

Support handling multidimensional arrays #34183

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

remeio
Copy link
Contributor

@remeio remeio commented Jan 1, 2025

Resolve TODO: TODO - only handles 2-dimensional arrays.

For method org.springframework.beans.AbstractNestablePropertyAccessor#newValue:

  • When arg type is Integer[][][].class, it will return a 2-dimensional array instance like[[]].

After this PR, this method support handling multidimensional arrays:

  • When arg type is Integer[][][].class, it will return a 3-dimensional array instance like [[[]]].

But actually, this final behavior is correct before this PR. For example:

  • Test case org.springframework.beans.BeanWrapperAutoGrowingTests#getPropertyValueAutoGrow3dArray had passed.

So I just fix this method newValue.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Jan 1, 2025
@snicoll
Copy link
Member

snicoll commented Jan 1, 2025

@remeio thanks for the PR but there are no tests that showcase what the code has changed. We can't consider the PR until you amend it with additional unit tests.

@snicoll snicoll added the status: waiting-for-feedback We need additional information before we can continue label Jan 1, 2025
@remeio
Copy link
Contributor Author

remeio commented Jan 1, 2025

@snicoll Hi,I had add the test case for list of 3-dimensional array like List<Bean[][][]>.

I think the default 3-dimensional array should be [[[]]]. But it is [[]] before this PR.

You can see the test method: getPropertyValueAutoGrow3dArrayListForDefault3dArray

Look forward to your reply.

@spring-projects-issues spring-projects-issues added status: feedback-provided Feedback has been provided and removed status: waiting-for-feedback We need additional information before we can continue labels Jan 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: feedback-provided Feedback has been provided status: waiting-for-triage An issue we've not yet triaged or decided on
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants