| ConcurrentModificationException | ConcurrentModificationException 2007-01-12 - By peter reilly
Also as the lock is on the hashtable, no new locks are added as the iteration will use the same lock.
On 1/12/07, Matt Benson <gudnabrsam@(protected)> wrote: > --- Steve Loughran <stevel@(protected)> wrote: > > > Matt Benson wrote: > > > I agree, Peter. However, the patch I am currently > > > testing adds synchro blocks to all Hashtable > > copies in > > > PropertyHelper. :) > > > > > > -Matt > > > > Just as long as we don't get deadlocks. > > > > > > When I was updating the diagnostics for Ant1.7.1 > > when a task doesnt get > > found, the IDE (intellij) was flagging what it felt > > were concurrency > > issues, places inside ComponentHelper where stuff > > was being accessed in > > both syncrhonized and unsynchronized locations. I > > left it all alone, > > because IDEA is over-paranoid, and because I like to > > understand the code > > better before wrapping everything. > > Yes, I looked at this stuff, but these were all cases > of > > public Hashtable getFooProperties() { > return new Hashtable(fooProperties); > } > > All I did was place synchronized (fooProperties) {} > around that statement (the constructor call being the > important piece, obviously), to ensure no wayward > put()s would hit fooProperties while Hashtable's > constructor was presumably iterating over its > contents. I can't see any danger there; that doesn't > mean somebody cooler than I won't, however. ;) > > -Matt > > > > > -steve > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: > > user-unsubscribe@(protected) > > For additional commands, e-mail: > > user-help@(protected) > > > > > > > > > _____________________________________________________________________________ _______ > Get your own web address. > Have a HUGE year through Yahoo! Small Business. > http://smallbusiness.yahoo.com/domains/?p=BESTDEAL > > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscribe@(protected) > For additional commands, e-mail: user-help@(protected) > >
--------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@(protected) For additional commands, e-mail: user-help@(protected)
|
|
 |