4 Replies Latest reply on May 15, 2013 10:18 AM by dward

    SwitchYard RemoteInvoker DeSerialization Bug

    yusufb

      Hi there,

       

      There seems to be a SERIOUS deserialization bug in the org.switchyard.serial.graph.node.AccessNode class. The symptom of this bug is:

       

      If you serialize an object with multiple properties that have the same underlying value using SwitchYard RemoteInvoker (on the client side), upon derialisation of the object (on the server side) only the first property (in alphabetical order) has the correct value. All the other properties on the object have a NULL value.

       

      For example, if you serialize 3 String properties like variable1, variable2 and variable3 with a value of "abc", upon deserialization variable1 will have a value of "abc", but variable2 and variable3 will have a value of NULL.

       

      I believe the root cause of the issue is on Line 141 of the org.switchyard.serial.graph.node.AccessNode class in the decompose method:

       

      141     if (!_resolutions.contains(id)) {
      142                        _resolutions.add(id);
      

       

      where id contains the list of values for the properties that are serialized. While serializing, if a value for a property has already been stored for another property, the 2nd property's value points to the value of the 1st property (the same id). Upon deserialization however, only the value of the first property is restored. This fact is then cached in the resolutions Set. For every subsequent field that points to this same value (like the 2nd property), we ignore the value. Therefore all subsequent properties/fields will have a NULL value.

       

      Any other thoughts?

       

      Thanks,

      Yusuf