Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
1.6.2
-
None
-
None
Description
For instance,
public class Alice {
private String comment;
private String name;
public Alice();
public Alice(String comment)
public String toString()
{ return "[name:"+name+", comment:"+comment+"]"; }}
if invoking :
client.setReturnType(new Class[]
);
Alice[] ar = (Alice[]) client.invokeBlocking(new Object[3]);
Then the deserialised array contains object instantiated with calls to Alice(obj.toString()). If one removes the Alice(String s) constructor then the array is correct, Alice objects are instantiated properly.
The root cause is the method ConvertToArbitraryObjectArray in org.apache.axis2.databinding.utils.ConverterUtil
—
Array.set(returnArray, i, getObjectForClass(
baseArrayClass,
o.toString()));
—
The one test that refers to this is testBigInteger in ConverterUtilTest, so I propose the following fix :
if (! ADBBean.class.isAssignableFrom(baseArrayClass) &&
java.lang.Number.class.isAssignableFrom(baseArrayClass)) {
The ConvertUtilTest is then ok, as well as any array of Alice !