Author: dkulp Date: Thu Oct 4 19:34:30 2012 New Revision: 1394220 URL: http://svn.apache.org/viewvc?rev=1394220&view=rev Log: Merged revisions 1394217 via git cherry-pick from https://svn.apache.org/repos/asf/cxf/branches/2.6.x-fixes
........ r1394217 | dkulp | 2012-10-04 15:27:31 -0400 (Thu, 04 Oct 2012) | 10 lines Merged revisions 1394216 via git cherry-pick from https://svn.apache.org/repos/asf/cxf/trunk ........ r1394216 | dkulp | 2012-10-04 15:25:56 -0400 (Thu, 04 Oct 2012) | 2 lines [CXF-4534] Add a bunch of extra map types into Aegis ........ ........ Modified: cxf/branches/2.5.x-fixes/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/collection/MapType.java Modified: cxf/branches/2.5.x-fixes/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/collection/MapType.java URL: http://svn.apache.org/viewvc/cxf/branches/2.5.x-fixes/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/collection/MapType.java?rev=1394220&r1=1394219&r2=1394220&view=diff ============================================================================== --- cxf/branches/2.5.x-fixes/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/collection/MapType.java (original) +++ cxf/branches/2.5.x-fixes/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/collection/MapType.java Thu Oct 4 19:34:30 2012 @@ -23,7 +23,14 @@ import java.util.HashSet; import java.util.Hashtable; import java.util.Iterator; import java.util.Map; +import java.util.NavigableMap; import java.util.Set; +import java.util.SortedMap; +import java.util.TreeMap; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.ConcurrentMap; +import java.util.concurrent.ConcurrentNavigableMap; +import java.util.concurrent.ConcurrentSkipListMap; import javax.xml.namespace.QName; @@ -118,15 +125,22 @@ public class MapType extends AegisType { protected Map<Object, Object> instantiateMap() { Map<Object, Object> map = null; - if (getTypeClass().equals(Map.class)) { + Class<?> cls = getTypeClass(); + if (cls.equals(Map.class)) { map = new HashMap<Object, Object>(); - } else if (getTypeClass().equals(Hashtable.class)) { + } else if (cls.equals(Hashtable.class)) { map = new Hashtable<Object, Object>(); - } else if (getTypeClass().isInterface()) { + } else if (cls.equals(ConcurrentMap.class)) { + map = new ConcurrentHashMap<Object, Object>(); + } else if (cls.equals(ConcurrentNavigableMap.class)) { + map = new ConcurrentSkipListMap<Object, Object>(); + } else if (cls.equals(SortedMap.class) || cls.equals(NavigableMap.class)) { + map = new TreeMap<Object, Object>(); + } else if (cls.isInterface()) { map = new HashMap<Object, Object>(); } else { try { - map = (Map<Object, Object>)getTypeClass().newInstance(); + map = (Map<Object, Object>)cls.newInstance(); } catch (Exception e) { throw new DatabindingException("Could not create map implementation: " + getTypeClass().getName(), e);
