You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by bu...@apache.org on 2004/12/30 19:05:32 UTC

DO NOT REPLY [Bug 32894] New: - CopyCommand does not work unless setValue is called

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=32894>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=32894

           Summary: CopyCommand does not work unless setValue is called
           Product: Commons
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: chain
        AssignedTo: commons-dev@jakarta.apache.org
        ReportedBy: slough@gmail.com


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);

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org