Well, you create JsonArray with an Array which make list in
JsonArray as a fixed-size list, so iterator remove dosen't support this
operation.
You could create JsonArray with List<String> which would be work as you
wanna.
but i think this would be a little fault of vert.x
>> > On 11 June 2013 18:30, Scott Brown <
scott...@gmail.com <javascript:>>
>> wrote:
>> >
>> >> Good afternoon,
>> >>
>> >> I got around this by using a for loop, but I'm confused as how the
>> >> iterator is supposed to function?
>> >>
>> >>
>> >> This code with a JsonArray containing one JsonObject results in an
>> >> infinite loop:
>> >>
>> >> while(jsonArray.iterator().hasNext()) {
>> >> JsonObject myObject = jsonArray.iterator().next();
>> >> }
>> >>
>> >>
>> >> This code with a JsonArray containing one JsonObject results in an
>> >> exception on the call to remove:
>> >>
>> >> while(jsonArray.iterator().hasNext()) {
>> >> JsonObject myObject = jsonArray.iterator().next();
>> >> jsonArray.iterator().remove();
>> >> }
>> >>
>> >> Was I doing it wrong?
>> >>
>> >> --
>> >> You received this message because you are subscribed to the Google
>> Groups
>> >> "vert.x" group.
>> >> To unsubscribe from this group and stop receiving emails from it, send
>> an
>> >> email to
vertx+un...@googlegroups.com <javascript:>.