Goktug Gokdogan has posted comments on this change.

Change subject: Widget Iterator now throws NoSuchElementExceptions correctly.
......................................................................


Patch Set 2:

(7 comments)

....................................................
File user/src/com/google/gwt/user/client/ui/WidgetCollection.java
Line 36:   private class WidgetIterator implements Iterator<Widget> {
I guess everything would be easier by just tracking current index here.

See below:


Line 38:     private int index = -1;
index = 0


Line 41:       return index < (size - 1);
index < size;


Line 48:       return array[++index];
return array[index++]


Line 52:       if ((index < 0) || (index >= size)) {
if (index < size)

Actually both this and old behavior is not correct. You can not call remove before calling next. You might also want to fix that. (It can be fixed by tracking additional state in both cases.)


Line 55:       parent.remove(array[index--]);
parent.remove(array[index]);


....................................................
File user/test/com/google/gwt/user/client/ui/WidgetCollectionTest.java
Line 102:   public void testExceptionInInterator() {
+1


--
To view, visit https://gwt-review.googlesource.com/2440
To unsubscribe, visit https://gwt-review.googlesource.com/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I07fd1507226a185b94ae1e85b6eb0235ec370a9f
Gerrit-PatchSet: 2
Gerrit-Project: gwt
Gerrit-Branch: master
Gerrit-Owner: Daniel Kurka <[email protected]>
Gerrit-Reviewer: Brian Slesinsky <[email protected]>
Gerrit-Reviewer: Daniel Kurka <[email protected]>
Gerrit-Reviewer: Goktug Gokdogan <[email protected]>
Gerrit-Reviewer: Matthew Dempsky <[email protected]>
Gerrit-Reviewer: Thomas Broyer <[email protected]>
Gerrit-HasComments: Yes

--
--
http://groups.google.com/group/Google-Web-Toolkit-Contributors
--- You received this message because you are subscribed to the Google Groups "Google Web Toolkit Contributors" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to