[ http://issues.apache.org/jira/browse/XMLRPC-36?page=all ] Daniel Rall resolved XMLRPC-36: -------------------------------
Fix Version: 1.2 Resolution: Fixed This issue was already fixed in the 1.2 line by Martin Poeschl in r233711 for XmlRpc.java, and in r233891 for SimpleXmlRpcClient.java by me. > 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 > Assignee: Daniel Rall > Fix For: 1.2 > > 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