You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Daniel Kulp (JIRA)" <ji...@apache.org> on 2010/03/18 18:18:27 UTC

[jira] Resolved: (CXF-2720) MapType doesn't deserialize subclass instances

     [ https://issues.apache.org/jira/browse/CXF-2720?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Daniel Kulp resolved CXF-2720.
------------------------------

       Resolution: Fixed
    Fix Version/s: 2.2.7
         Assignee: Daniel Kulp

Patch applied.   Thanks!

> MapType doesn't deserialize subclass instances
> ----------------------------------------------
>
>                 Key: CXF-2720
>                 URL: https://issues.apache.org/jira/browse/CXF-2720
>             Project: CXF
>          Issue Type: Bug
>          Components: Aegis Databinding
>    Affects Versions: 2.2.6
>         Environment: All
>            Reporter: Michael Berkowitz
>            Assignee: Daniel Kulp
>             Fix For: 2.2.7
>
>         Attachments: MapType.java
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> Given an object of type {{Map<TKey, TValue>}}, where, say, {{TValue}} is a base class extended by {{TValuePrime}}, when a serialized instance contains a value of type {{TValuePrime}}, *MapType* will try to deserialize it as a {{TValue}}, ignoring the fact that it's really an instance of {{TValuePrime}}. In many cases this will throw an exception when trying to _set_ a member that exists only in {{TValuePrime}}.   (We have observed this for the value class, but it should be true of the key class as well).
> We have fixed this - as far as we can tell - by swiping code from *ArrayType*, which handles these things correctly.  We're attaching our new version of *MapType.java*.
> Lacking a deep understand of the Aegis code, we did this by intuition and trial-and-error, so it may be inefficient or even technically incorrect, but so far it works for us.  Please get this fix, or its functional equivalent, into the codebase.
> Thanks in advance.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.