Uploaded image for project: 'Commons Chain'
  1. Commons Chain
  2. CHAIN-6

[chain] CopyCommand does not work unless setValue is called

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.1
    • None
    • None
    • Operating System: All
      Platform: All

    • 32894

    Description

      CopyCommand appears to only work if the setValue method is run. The
      documentation says "... a context attribute stored under the fromKey (if any),
      to the toKey". If only the fromKey and toKey are set, the toKey and its stored
      value are deleted from the Context regardless of fromKey's value. This should
      only happen if the fromKey value is null.

      In the execute method of CopyCommand, it appears that
      if (value == null)

      { context.get(getFromKey()); }

      should read

      if (value == null)

      { value = context.get(getFromKey()); }

      then the rest of the code should function as expected:

      if (value != null)

      { context.put(getToKey(), value); }

      else

      { context.remove(getToKey()); }

      return (false);

      Attachments

        Activity

          People

            Unassigned Unassigned
            slough@gmail.com William Slough
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: