Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-2720

MapType doesn't deserialize subclass instances

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.2.6
    • 2.2.7
    • Aegis Databinding
    • None
    • All

    • Novice

    Description

      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.

      Attachments

        1. MapType.java
          9 kB
          Michael Berkowitz

        Activity

          People

            dkulp Daniel Kulp
            daythryl Michael Berkowitz
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 24h
                24h
                Remaining:
                Remaining Estimate - 24h
                24h
                Logged:
                Time Spent - Not Specified
                Not Specified