The implementation of AbstractNestablePropertyAccessor.processKeyedProperty
results in a java.lang.IllegalArgumentException: array element type mismatch
when the property expression has more than one property key and the last key causes the array to grow automatically.
For example, given a property int[][] multiArray = new int[2][2]
and property expression multiArray[1][3]
, the processKeyedProperty
method creates a new array object and assigns it to multiArray
; whereas, the new array object should be assigned to multiArray[1]
.
Comment From: nullzl
Please provide a unit test that fails before the change and passes after the change -- for example, something analogous to
org.springframework.beans.BeanWrapperAutoGrowingTests.getPropertyValueAutoGrowMultiDimensionalArray()
.Thanks
Thank you very much for your review. I have added a unit test org.springframework.beans.BeanWrapperAutoGrowingTests.setPropertyValueAutoGrowMultiDimensionalArray()
.
Comment From: sbrannen
This has been merged into master
in a33eac3ec05952424603d1fefc627b4a3ef36449, revised in 8baf404893037951ac29393a41d40af4fa11775b, and backported to 5.2.x
.
Thanks for catching and fixing this bug!