When constructing a multidimensional array in a SpEL expression, ConstructorReference.createArray() enforces a size limit by checking the product of all dimension sizes. However, Java allocates a distinct array object at every nesting level, and the current check does not consider this count.
Ideally, the MAX_ARRAY_ELEMENTS threshold should apply to both the product of all dimension sizes and the total number of array objects allocated across all nesting levels.
Since SimpleEvaluationContext does not permit array creation within SpEL expressions, this enhancement effectively only applies to expressions evaluated via StandardEvaluationContext.
NOTE: This issue is assigned and therefore not suitable for community contributions.
When constructing a multidimensional array in a SpEL expression,
ConstructorReference.createArray()enforces a size limit by checking the product of all dimension sizes. However, Java allocates a distinct array object at every nesting level, and the current check does not consider this count.Ideally, the
MAX_ARRAY_ELEMENTSthreshold should apply to both the product of all dimension sizes and the total number of array objects allocated across all nesting levels.Since
SimpleEvaluationContextdoes not permit array creation within SpEL expressions, this enhancement effectively only applies to expressions evaluated viaStandardEvaluationContext.NOTE: This issue is assigned and therefore not suitable for community contributions.