Uploaded image for project: 'Errai'
  1. Errai
  2. ERRAI-794

Marshaller loses instances constructed in wrong order

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Minor
    • Resolution: Done
    • Affects Version/s: 3.0.2.Final
    • Fix Version/s: 3.0.3.Final, 3.1.0.Final
    • Component/s: None
    • Labels:
      None
    • Environment:

      Wildfly 8.1

    • Steps to Reproduce:
      Hide

      @Portable
      public class Exp3 {
      private final Nested3 key;
      private final List<Nested3> keys;

      public Exp3(@MapsTo("keys") List<Nested3> keys, @MapsTo("key") Nested3 key)

      { this.key = key; this.keys = keys; }

      @Portable
      public static class Nested3 {
      private final String value;

      public Nested3(@MapsTo("value") String value)

      { this.value = value; }

      @Override
      public String toString()

      { return "Nested3 [value=" + value + "]"; }

      }

      @Override
      public String toString()

      { return "Exp3 [key=" + key + ", keys=" + keys + "]"; }

      }

      Sending an instance of that class with
      Nested3 key = new Nested3("exp3");
      return new Exp3(Arrays.asList(key), key);

      will cause key to be null on the client.

      Show
      @Portable public class Exp3 { private final Nested3 key; private final List<Nested3> keys; public Exp3(@MapsTo("keys") List<Nested3> keys, @MapsTo("key") Nested3 key) { this.key = key; this.keys = keys; } @Portable public static class Nested3 { private final String value; public Nested3(@MapsTo("value") String value) { this.value = value; } @Override public String toString() { return "Nested3 [value=" + value + "]"; } } @Override public String toString() { return "Exp3 [key=" + key + ", keys=" + keys + "]"; } } Sending an instance of that class with Nested3 key = new Nested3("exp3"); return new Exp3(Arrays.asList(key), key); will cause key to be null on the client.

      Description

      Having an instance multiple times in the same serialization graph can cause the instance to be null depending on order of constructor parameters.

      If the instance is used first in a List it is lost (null on every occurence), if it is stored directly first (exchange the parameter order) it works as expected

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                csa Christian Sadilek
                Reporter:
                k5__ Frank Denninger
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: