Skip to content

Account for all array objects when checking array size in SpELΒ #36998

Closed

Description

@sbrannen

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.

Activity

  1. added this to the 7.1.x milestone on Jul 2, 2026
  2. self-assigned this
    on Jul 2, 2026
  3. added
    in: coreIssues in core modules (aop, beans, core, context, expression)
    on Jul 2, 2026
  4. modified the milestones: 7.1.x, 7.1.0-M2 on Aug 21, 2026
  5. added a commit that references this issue on Aug 21, 2026
    9dabfe9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)type: enhancementA general enhancement

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions