Return-Path: X-Original-To: apmail-cxf-commits-archive@www.apache.org Delivered-To: apmail-cxf-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 0B026D80C for ; Thu, 4 Oct 2012 19:28:16 +0000 (UTC) Received: (qmail 3611 invoked by uid 500); 4 Oct 2012 19:28:15 -0000 Delivered-To: apmail-cxf-commits-archive@cxf.apache.org Received: (qmail 3563 invoked by uid 500); 4 Oct 2012 19:28:15 -0000 Mailing-List: contact commits-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list commits@cxf.apache.org Received: (qmail 3555 invoked by uid 99); 4 Oct 2012 19:28:15 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 04 Oct 2012 19:28:15 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 04 Oct 2012 19:28:14 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id A2D2D238896F; Thu, 4 Oct 2012 19:27:31 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1394217 - /cxf/branches/2.6.x-fixes/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/collection/MapType.java Date: Thu, 04 Oct 2012 19:27:31 -0000 To: commits@cxf.apache.org From: dkulp@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20121004192731.A2D2D238896F@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: dkulp Date: Thu Oct 4 19:27:31 2012 New Revision: 1394217 URL: http://svn.apache.org/viewvc?rev=1394217&view=rev Log: 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.6.x-fixes/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/collection/MapType.java Modified: cxf/branches/2.6.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.6.x-fixes/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/collection/MapType.java?rev=1394217&r1=1394216&r2=1394217&view=diff ============================================================================== --- cxf/branches/2.6.x-fixes/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/collection/MapType.java (original) +++ cxf/branches/2.6.x-fixes/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/collection/MapType.java Thu Oct 4 19:27:31 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 instantiateMap() { Map map = null; - if (getTypeClass().equals(Map.class)) { + Class cls = getTypeClass(); + if (cls.equals(Map.class)) { map = new HashMap(); - } else if (getTypeClass().equals(Hashtable.class)) { + } else if (cls.equals(Hashtable.class)) { map = new Hashtable(); - } else if (getTypeClass().isInterface()) { + } else if (cls.equals(ConcurrentMap.class)) { + map = new ConcurrentHashMap(); + } else if (cls.equals(ConcurrentNavigableMap.class)) { + map = new ConcurrentSkipListMap(); + } else if (cls.equals(SortedMap.class) || cls.equals(NavigableMap.class)) { + map = new TreeMap(); + } else if (cls.isInterface()) { map = new HashMap(); } else { try { - map = (Map)getTypeClass().newInstance(); + map = (Map)cls.newInstance(); } catch (Exception e) { throw new DatabindingException("Could not create map implementation: " + getTypeClass().getName(), e);