Serialization of negative int value
chrisCesar34 opened this issue · 10 comments
When serializing an object having negative int value for one of its instance field, the returned serialized object have a weird value instead of the negative int value.
For example, if I call the following piece of code with an object having -50 as value for one of its int field, the serialized value for this field is 4294967246;
VPack vpack = vpack();
System.out.println(vpack.serialize(object).toString());
@chrisCesar34 There was a bug in vpack-json parsing which I fixed a couple of weeks ago (see here). You can try it out by using version 1.0.12-SNAPSHOT. I will release a new version within this month
@mpv1989 we use velocypack 1.0.11 with with arangodb-java-driver 4.2.4. We will test the snapshot a give you the result. Thanks.
@mpv1989 i works with @chrisCesar34 . The problem remains unresolved with the SNAPSHOT version.
I described how to reproduce it in this related issue: arangodb/arangodb-java-driver#151
@chrisCesar34 @gontard Sry for the late response.
I added some tests. It seems like the problem only occurs when serializing an negative int and deserializing it as long. I am on it.
@chrisCesar34 @gontard I pushed a fix. Tests are green, if it works for you I will release a new version.
Hello @mvp,
thanks for your help. I tried the latest 1.0.12-SNAPSHOT and unfortunately the fix does not correct our issue.
Could you try to reproduce my problem using the test i have attached to this related issue arangodb/arangodb-java-driver#151 ?
@gontard @chrisCesar34 Thanks for the response. I reproduced the problem with your test (thanks for that). I was able to fix the problem. I will write some more tests and see whether I find a better solution then the current one.
I already deployed the current snapshot. Feel free to test.
@mpv1989 I just finish to test with the last SNAPSHOT and it works !
Thanks a lot for your help.
When can we expect a new release with this fix ?