Return-Path: Delivered-To: apmail-cxf-issues-archive@www.apache.org Received: (qmail 61421 invoked from network); 11 Nov 2008 15:43:35 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 11 Nov 2008 15:43:35 -0000 Received: (qmail 58372 invoked by uid 500); 11 Nov 2008 15:43:42 -0000 Delivered-To: apmail-cxf-issues-archive@cxf.apache.org Received: (qmail 58353 invoked by uid 500); 11 Nov 2008 15:43:42 -0000 Mailing-List: contact issues-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 issues@cxf.apache.org Received: (qmail 58342 invoked by uid 99); 11 Nov 2008 15:43:42 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 11 Nov 2008 07:43:42 -0800 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 11 Nov 2008 15:42:31 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 5E646234C28D for ; Tue, 11 Nov 2008 07:42:44 -0800 (PST) Message-ID: <1479201746.1226418164385.JavaMail.jira@brutus> Date: Tue, 11 Nov 2008 07:42:44 -0800 (PST) From: "Marcus Christie (JIRA)" To: issues@cxf.apache.org Subject: [jira] Updated: (CXF-1906) Unmarshalling Set to TreeSet instead of HashSet In-Reply-To: <1661425117.1226417924331.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/CXF-1906?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Marcus Christie updated CXF-1906: --------------------------------- Attachment: CXF-1906_patch.txt Patch to fix Set/SortedSet bug. > Unmarshalling Set to TreeSet instead of HashSet > ----------------------------------------------- > > Key: CXF-1906 > URL: https://issues.apache.org/jira/browse/CXF-1906 > Project: CXF > Issue Type: Bug > Components: Aegis Databinding > Affects Versions: 2.1.3 > Reporter: Marcus Christie > Priority: Critical > Attachments: CXF-1906_patch.txt > > > When using the Aegis databinding, if you are deserializing to a class that has a Set in it, Aegis is currently instantiating the set as a SortedSet. This fails for cases where the objects being added to the set do not implement Comparable, and is undesired in any case. > The error occurs in CollectionType.java: > {code:java} > protected Collection createCollection() { > Collection values = null; > if (getTypeClass().isAssignableFrom(List.class)) { > values = new ArrayList(); > } else if (getTypeClass().isAssignableFrom(SortedSet.class)) { > values = new TreeSet(); > } else if (getTypeClass().isAssignableFrom(Set.class)) { > values = new HashSet(); > } else if (getTypeClass().isAssignableFrom(Vector.class)) { > values = new Vector(); > } else if (getTypeClass().isInterface()) { > values = new ArrayList(); > } else { > .... > {code} > If the typeClass is Set, then the second "if" clause evaluates to true since Set is a superclass/superinterface of SortedSet. > I've got a patch I'll submit and I'll explain the fix. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.