Menu

#1 HessianReader.readList() inserts extra null elements to list

open
nobody
5
2007-01-17
2007-01-17
Anonymous
No

PROBLEM:
HessianReader.readList() inserts extra 'null' elements in AS3 Array when reading a nested list.

REPRODUCTION:
On the server side, a servlet returns a simple 2-dimensional array as follows:

String[][] ttt = {{"a","b"},{"c","d"}};

When this is parsed by the HessianReader class, an extra 'null' element is inserted into the AS3 Array after parsing {"a","b"} and {"c","d"} respectively.

Specifically, it appears that the last 'z' is not consumed by HessianReader. Note that this problem does not occur for a 1-dimensional array.

WORK-AROUND:
To consume the extra 'z', the following line was added to HessianReader.readList():

for (i = 0; i < length; i++)
array[i] = read();
$(); // <---- ADDED THIS LINE

NOTE: this may not be the best implementation, but at least for now it appears to solve the problem.

Discussion


Log in to post a comment.

MongoDB Logo MongoDB