File tree Expand file tree Collapse file tree 2 files changed +14
-3
lines changed
main/java/org/springframework/beans
test/java/org/springframework/beans Expand file tree Collapse file tree 2 files changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -521,7 +521,6 @@ private Collection<?> convertToTypedCollection(
521
521
}
522
522
523
523
boolean originalAllowed = requiredType .isInstance (original );
524
- typeDescriptor = typeDescriptor .narrow (original );
525
524
TypeDescriptor elementType = typeDescriptor .getElementTypeDescriptor ();
526
525
if (elementType == null && originalAllowed &&
527
526
!this .propertyEditorRegistry .hasCustomEditorForElement (null , propertyName )) {
@@ -603,7 +602,6 @@ private Collection<?> convertToTypedCollection(
603
602
}
604
603
605
604
boolean originalAllowed = requiredType .isInstance (original );
606
- typeDescriptor = typeDescriptor .narrow (original );
607
605
TypeDescriptor keyType = typeDescriptor .getMapKeyTypeDescriptor ();
608
606
TypeDescriptor valueType = typeDescriptor .getMapValueTypeDescriptor ();
609
607
if (keyType == null && valueType == null && originalAllowed &&
Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2002-2014 the original author or authors.
2
+ * Copyright 2002-2015 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
26
26
import java .util .LinkedList ;
27
27
import java .util .List ;
28
28
import java .util .Map ;
29
+ import java .util .Properties ;
29
30
import java .util .Set ;
30
31
31
32
import org .junit .Test ;
@@ -182,6 +183,18 @@ public void testGenericMapElementWithCollectionValue() {
182
183
assertTrue (gb .getCollectionMap ().get (new Integer (1 )) instanceof HashSet );
183
184
}
184
185
186
+ @ Test
187
+ public void testGenericMapFromProperties () {
188
+ GenericBean <?> gb = new GenericBean <Object >();
189
+ BeanWrapper bw = new BeanWrapperImpl (gb );
190
+ Properties input = new Properties ();
191
+ input .setProperty ("4" , "5" );
192
+ input .setProperty ("6" , "7" );
193
+ bw .setPropertyValue ("shortMap" , input );
194
+ assertEquals (new Integer (5 ), gb .getShortMap ().get (new Short ("4" )));
195
+ assertEquals (new Integer (7 ), gb .getShortMap ().get (new Short ("6" )));
196
+ }
197
+
185
198
@ Test
186
199
public void testGenericListOfLists () throws MalformedURLException {
187
200
GenericBean <String > gb = new GenericBean <String >();
You can’t perform that action at this time.
0 commit comments