ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matt Benson <gudnabr...@yahoo.com>
Subject Re: ConcurrentModificationException
Date Fri, 12 Jan 2007 18:50:34 GMT
--- Steve Loughran <stevel@apache.org> 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@ant.apache.org
> For additional commands, e-mail:
> user-help@ant.apache.org
> 
> 



 
____________________________________________________________________________________
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@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message