-
Notifications
You must be signed in to change notification settings - Fork 38.6k
Closed
Labels
in: coreIssues in core modules (aop, beans, core, context, expression)Issues in core modules (aop, beans, core, context, expression)type: bugA general bugA general bug
Milestone
Description
Overview
Due to the current implementation of SpEL's Indexer
, an IndexAccessor
cannot provide custom support for a Collection
target type.
The reason is that Indexer
owns the Collection
target type.
Lines 234 to 241 in a3afe51
else if (target instanceof Collection<?> collection) { | |
if (target instanceof List) { | |
this.indexedType = IndexedType.LIST; | |
} | |
return new CollectionIndexingValueRef(collection, idx, targetDescriptor, | |
state.getTypeConverter(), state.getConfiguration().isAutoGrowCollections(), | |
state.getConfiguration().getMaximumAutoGrowSize()); | |
} |
We should be able to ensure that a custom IndexAccessor
can provide support for a Collection
target type by separating our built-in List
and Collection
support and applying the built-in Collection
support after custom index accessors have been applied, analogous to what we did in #32706. The built-in List
support should still be applied before custom index accessors and therefore remain unchanged.
Related Issues
Metadata
Metadata
Assignees
Labels
in: coreIssues in core modules (aop, beans, core, context, expression)Issues in core modules (aop, beans, core, context, expression)type: bugA general bugA general bug