cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Benson Margulies (JIRA)" <j...@apache.org>
Subject [jira] Commented: (CXF-1906) Unmarshalling Set to TreeSet instead of HashSet
Date Mon, 17 Nov 2008 16:15:44 GMT

    [ https://issues.apache.org/jira/browse/CXF-1906?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12648184#action_12648184
] 

Benson Margulies commented on CXF-1906:
---------------------------------------

I expect that Willem will backport it.

> 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
>            Assignee: Benson Margulies
>            Priority: Critical
>             Fix For: 2.2
>
>         Attachments: CXF-1906_patch.txt, 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<Object> 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.


Mime
View raw message