You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Attempting to serialize and deserialize a queue of arrays, then calling addFirst or addLast on the Queue throws an array index out of bounds exception, refering to the field 'head' in Queue. This is definitely a problem with serialization since re-initialising the queue solves the problem. This error occurs in both version 1.1.0 and 1.1.1.
Interestingly, calling addFirst throws an ArrayIndexOutOfBoundsException: -1, whereas calling addLast throws an ArrayIndexOutOfBoundsException: 0.
The text was updated successfully, but these errors were encountered:
Sorry for the slow response. I haven't had a chance to look into this one yet. If you'd like to submit a testNestedCollection() to the collections tests that illustrates the failure, I'd certainly appreciate it.
Unfortunately, I accidentally placed the PC containing my only copy of my keystore in a storage unit buried with stuff I don't intend to retrieve for a couple years. Too painful to dig it out, so I'm debating whether I should create a new repository to get fixes out sooner. You're the first I know of who is using gdxtokryo besides myself.
After some testing I've found that 1) this issue affects all queues, not just nested ones and 2) it only affects empty queues.
I've written a test and submitted a pull request. I didn't use your equals method because on the surface, the original and deserialised queues look functionally identical, you only start seeing problems when you try to add to the deserialised one. So the test just throws an exception when you run it.
Also, I think there might be other people who use gdxtokryo. In fact, I found this repo when someone suggested it to me on the libGDX discord when I asked if anyone had written serialisers for common gdx classes.
EDIT: Just remembered that I found a temporary fix a while ago, if you use ensureCapacity on the deserialised queue, it works fine.
Attempting to serialize and deserialize a queue of arrays, then calling addFirst or addLast on the Queue throws an array index out of bounds exception, refering to the field 'head' in Queue. This is definitely a problem with serialization since re-initialising the queue solves the problem. This error occurs in both version 1.1.0 and 1.1.1.
Interestingly, calling addFirst throws an ArrayIndexOutOfBoundsException: -1, whereas calling addLast throws an ArrayIndexOutOfBoundsException: 0.
The text was updated successfully, but these errors were encountered: