-
Notifications
You must be signed in to change notification settings - Fork 38.8k
Description
Grzegorz Grzybek opened SPR-8518 and commented
@kdonald
In revision 4483 there was a change in org.springframework.expression.spel.support.ReflectionHelper.convertArguments(TypeConverter, Object[], Object, int[], Integer). Now all arguments are converted.
I have a problem with SpEL, where root object is map (but it's a general problem with Map arguments) - it's a problem w Java generics, where type arguments may be deducted from method parameters, but not from actual arguments:
// method
void mapArg(Map<String, Object> arg1);
// type descriptor for method parameter
new TypeDescriptor(MethodParameter.forMethodOrConstructor(methodOrCtor, i));
// type descriptor for actual argument
TypeDescriptor.forObject(argument)
Spring converts Map<String, Object> because it determines it's Map<?, ?>, which results in new Map being passed to actual method. When the map is EvaluationContext's root object, it's not the root map which is passed to SpEL invoked method, so I can't use SpEL to fill passed map...
I know it can't be resolved because of type erasure - but can this be specified in documentation somehow?
regards
Grzegorz Grzybek
Affects: 3.1 M2
Issue Links:
- 3.0.6 Map to Map conversion shallow copying maps causing unexpected results on upgrade from 3.0.5 [SPR-8714] #13356 3.0.6 Map to Map conversion shallow copying maps causing unexpected results on upgrade from 3.0.5