On Wed, Mar 18, 2009 at 6:10 PM, Ray Cromwell <[email protected]> wrote:
> > > On Wed, Mar 18, 2009 at 2:57 PM, Vitali Lovich <[email protected]> wrote: > >> First major concern is that I got a ConcurrentModificationException when >> iterating over a HashSet - this exception is completely meaningless in the >> context of the browser (no threading). There's also not really any >> meaningful message in the stack trace: >> > > It applies equally well to single-thread scenarios, see the JavaDoc: > http://java.sun.com/j2se/1.5.0/docs/api/java/util/ConcurrentModificationException.html > Right - I was just implying that seeing as how my code in no way actually modifies the set while iterating over it, the concurrent modification exception is meaningless. <http://java.sun.com/j2se/1.5.0/docs/api/java/util/ConcurrentModificationException.html> > > >> somehow fixes the problem. Is the compiler screwing up in converting the >> Java for-each notation into the iterator equivalent, or am I missing >> something? >> >> Some background: this succeeds the first time it is called from within an >> event handler context (to notify the model to perform a login attempt). >> However, it fails the second time it is called when it is called from an >> AsyncCallback context (returning the result that it was a successful >> login). However, at no point is the HashSet used modified (after startup >> where it contains currently 1 element). >> > > It's possible there's a bug, but perhaps you should try wrapping things in > Collections.unmodifableSet()/Map() to make sure it's not being modified in > some way. > Nope - still throws an exception. Nothing in the code example above modifies the hashset (I print a message when I register a listener, and I'm not getting that) - I'm going to verify this though (step through the first successful call) > -Ray > > > > > --~--~---------~--~----~------------~-------~--~----~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~----------~----~----~----~------~----~------~--~---
