Skip to content

Auto-growing of collections should be implemented for collection writing as well as reading [SPR-6984] #11649

@spring-projects-issues

Description

@spring-projects-issues

Andy Clement opened SPR-6984 and commented

The ability to auto-grow collections (when a reference is made to an index beyond the current end of the collection) is currently only supported for read, it should also be supported for write. For example, this code:

expression = parser.parseExpression("address.crossStreets[0]");
expression.getValue(context);

automatically ensures crossStreets is grown to include a first entry and returns it (if the parser has been configured to auto-grow collections). This fails:

expression = parser.parseExpression("address.crossStreets[0]");
expression.setValue(context,"Foo");

with an error indicating the collection is null.


Affects: 3.0.1

Referenced from: commits d932c04

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