-
Notifications
You must be signed in to change notification settings - Fork 38.8k
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
!!Use pwebb rather than philw opened SPR-8364 and commented
Using the latest snapshot build of Spring 3.1 an IllegalArgumentException is thrown from Spring Security FilterChainProxy.checkContents.
After a bit of hunting I believe that this is due to an error in the converter service. The conversion services is being invoked to convert Map<String,List<Filter>> to Map<Object,Object>, this invokes the MapToMapConverter for the Map and then the CollectionToObjectConverter. The collection to object converter returns the 1st item in the list and discards the rest.
Here is a test case that you can use to verify. This will pass on 3.0.5 and fail on 3.1.0.BUILD-SNAPSHOT
@Test
@SuppressWarnings("unchecked")
public void shouldConvertMaps() throws Exception {
HashMap<String, List<Integer>> src = new LinkedHashMap<String, List<Integer>>();
List<Integer> value = new ArrayList<Integer>();
value.add(1);
value.add(2);
value.add(3);
src.put("k", value);
GenericConversionService cs = ConversionServiceFactory.createDefaultConversionService();
Map<Object, Object> converted = cs.convert(src, Map.class);
assertEquals(value, converted.get("k"));
}
Affects: 3.1 M1
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