Uploaded image for project: 'Syncope'
  1. Syncope
  2. SYNCOPE-285 Complete CXF migration
  3. SYNCOPE-246

Remove collection setters in transfer objects for JAXB marshalling

    Details

    • Type: Sub-task
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.1.0
    • Fix Version/s: 1.2.0-M1
    • Component/s: core
    • Labels:
      None
    • Environment:
      CXF branch

      Description

      XML payload will be marshaled/unmarshaled using JAXB by migration to CXF Rest frontend.
      JAXB works with collections in a little bit different way as Spring Rest marshaling.
      JAXB uses only getter for the list (assumes that list is initialized due object creation) and adds elements into the list obtained by getter by unmarshaling. It doesn't need setter at all.
      The problem is that actual implementation of transfer objects doesn't work with JAXB.
      If TO provide setter for collection, JAXB gets the list, adds the elements and additionally calls setter for this list. As far as setter logic cleans the TO collection, the result collection is always empty.
      Solution is remove setters for collections in TOs by migration on CXF Rest.
      I find it also better from security and encapsulation aspects.

      Regards,
      Andrei.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                ilgrosso Francesco Chicchiriccò
                Reporter:
                ashakirin Andrei Shakirin
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: