harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tim Ellison <t.p.elli...@gmail.com>
Subject Re: svn commit: r413531 - /incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/FeatureDescriptor.java
Date Tue, 13 Jun 2006 08:56:17 GMT
Nathan Beyer wrote:
>> -----Original Message-----
>> From: Tim Ellison [mailto:t.p.ellison@gmail.com]
<snip>
>> They are not quite equivalent, since the code above enumerates over the
>> actual 'values' keySet.  If code calling attributeNames() removes a
>> value they are removing it from the FeatureDescriptor's private HashMap
>> variable, which is probably not what we want.  Creating a new collection
>> (Vector) of the values protects the code from that.
> 
> The method returns an Enumeration though and there's no method for removing
> items from an Enumeration.

Oops, you are right (I was thinking of an Iterator), but the keySet can
be modified by setValue(String,Object) so copying the keys provides some
stability if callers are setting values while enumerating.

Regards,
Tim

-- 

Tim Ellison (t.p.ellison@gmail.com)
IBM Java technology centre, UK.

---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org


Mime
View raw message