JieZhu / google-gson

Automatically exported from code.google.com/p/google-gson
0 stars 0 forks source link

pathIndices not updated #607

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create a new instance of JsonReader with this json: "{\"array\" 
:[{\"test\":1},{\"test\":1},{\"test\":1}]}"
2. Let the reader read all items until the second object in the array with 
these statements:
reader.beginObject();
reader.nextName();
reader.beginArray();
reader.beginObject();
reader.nextName();
reader.nextInt();
reader.endObject();
reader.beginObject();
3. See that the JsonPath = $.array[0]. while the reader is in the second object 
of the array so the value should be $.array[1].

What is the expected output? What do you see instead?
When i close an object in an array i expect the JsonPath index of that array to 
be increased. Instead it stays the same.

What version of the product are you using? On what operating system?
2.3 in an android gradle project on OSX

Please provide any additional information below.
In all the next.... methods of JsonReader the pathIndex of the top item of the 
stack is increased by 1. This does not happen in endObject or endArray.

Original issue reported on code.google.com by remcomok...@gmail.com on 10 Nov 2014 at 8:49

GoogleCodeExporter commented 9 years ago
My bug! Fix:
https://code.google.com/p/google-gson/source/detail?r=1303

Original comment by limpbizkit on 11 Nov 2014 at 2:00