Uploaded image for project: 'Spring Web Flow'
  1. Spring Web Flow
  2. SWF-1094

Merge process causes duplicate entries in parent transitions.

    XMLWordPrintable

    Details

      Description

      As a result, after merging in flow3:list:show will be 6 actions (which is correct), but in flow1:list:show will be the 6 objects too (which is wrong).

      Wrong behavior takes place, because actions shares the same LinkedList.

      In your source code:
      public void merge(Model model)

      { TransitionModel transition = (TransitionModel) model; setOnException(merge(getOnException(), transition.getOnException())); setTo(merge(getTo(), transition.getTo())); setBind(merge(getBind(), transition.getBind())); setBind(merge(getValidate(), transition.getValidate())); <---- besides, are you sure this string is correct? setHistory(merge(getHistory(), transition.getHistory())); setAttributes(merge(getAttributes(), transition.getAttributes())); setSecured((SecuredModel) merge(getSecured(), transition.getSecured())); setActions(merge(getActions(), transition.getActions(), false)); <------------- wrong. }

      Proposed change:
      LinkedList mergeResult = merge(getActions(), transition.getActions(), false);
      setActions(mergeResult != null ? new LinkedList(mergeResult) : null);

        Attachments

        1. SWF-1094.patch
          24 kB
        2. swf1094.zip
          2 kB
        3. testProject.zip
          18 kB
        4. testProject2.zip
          12 kB

          Activity

            People

            Assignee:
            kdonald Keith Donald
            Reporter:
            maksar Maksar
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: