Skip to content

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
@rstoyanchev rstoyanchev added the in: core Issues in core modules (aop, beans, core, context, expression) label Feb 3, 2025
@snicoll snicoll changed the title Support handling multidimensional arrays Add support for multidimensional arrays Feb 5, 2025
@snicoll snicoll self-assigned this Feb 5, 2025
@snicoll snicoll added type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged or decided on status: feedback-provided Feedback has been provided labels Feb 5, 2025
@snicoll snicoll added this to the 6.2.3 milestone Feb 5, 2025
snicoll pushed a commit that referenced this pull request Feb 5, 2025
snicoll added a commit that referenced this pull request Feb 5, 2025
@snicoll snicoll closed this in fd4dee7 Feb 5, 2025
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: enhancement A general enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants