Serialization/deserialization of Map does not retain correct datatype
---------------------------------------------------------------------
Key: XMLRPC-127
URL: http://issues.apache.org/jira/browse/XMLRPC-127
Project: XML-RPC
Issue Type: Bug
Components: Source
Affects Versions: 3.1
Reporter: Jimisola Laursen
Priority: Critical
Believe that this is quite severe bug unless I did something very wrong.
When sending/rretrieving a Map over XMLRPC the datatype is not correct. I've
only checked for the keys, but the error might exist for the values as well.
Provided is a simple unit test to illustrate the bug. To reproduce run the unit
tests in SerializationTest.
It has two test methods:
1) one that calls a static method and
2) and another that calls a method over XMLRPC which in turns call the same
static method
The latter fails with a ClassCastException. Instead of the key being the
expected Integer it is a String.
>From Console:
[...]
key: 21
value: twentyone
21 -> 'twentyone'
key: 1
value: one
1 -> 'one'
[...]
key: 21
>From Debug -> Variables (in Eclipse):
entry HashMap$Entry<K,V> (id=13)
key "21"
count 2
hash 1599
offset 0
value char[2] (id=27)
value "twentyone"
count 9
hash 0
offset 0
value char[9] (id=29)
As you can see 21 is a char[2] and not an integer as expected.
--
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