[ http://issues.apache.org/jira/browse/XMLRPC-36?page=all ]
     
Jochen Wiedmann closed XMLRPC-36:
---------------------------------

    Resolution: Won't Fix
     Assign To:     (was: rpc-dev mailing list)

Doesn't seem to apply to version 3. Please reopen, if required.


> Patch for bug with array or struct in SimpleXmlRpcClient
> --------------------------------------------------------
>
>          Key: XMLRPC-36
>          URL: http://issues.apache.org/jira/browse/XMLRPC-36
>      Project: XML-RPC
>         Type: Bug

>   Components: Source
>     Versions: unspecified
>  Environment: Operating System: All
> Platform: All
>     Reporter: Lee Haslup

>
> When a Value object is created to accumulate an array or a struct the setType
> method creates two objects of the given type.  One (referred to by the array 
> or
> struct variable) is used to accumulate the contents.  The other (referred to 
> by
> the value variable) is always empty.  The (always empty) value object is used 
> to
> construct the result and arrays or structs returned by the client's execute
> method are always empty.
> The following worked for me...
> The method setType in the Value class currently reads...
> /**
>  * Set the type of this value. If it's a container, create the
>  * corresponding java container.
>  */
> public void setType(int type)
> {
>    // System.err.println ("setting type to "+types[type]);
>    this.type = type;
>    if (type == ARRAY)
>      {
>         value = new Vector();
>         array = new Vector();
>      }
>    if (type == STRUCT)
>      {
>         value = new Hashtable();
>         struct = new Hashtable();
>      }
> }
> It probably should read...
> /**
>  * Set the type of this value. If it's a container, create the
>  * corresponding java container.
>  */
> public void setType(int type)
> {
>    // System.err.println ("setting type to "+types[type]);
>    this.type = type;
>    if (type == ARRAY)
>       {
>         array = new Vector();
>         value = array;
>       }
>    if (type == STRUCT)
>       {
>         struct = new Hashtable();
>         value = struct;
>       }
> }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira

Reply via email to