Nathan Beyer wrote:
>> -----Original Message-----
>> From: Tim Ellison [mailto:[EMAIL PROTECTED]
<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 ([EMAIL PROTECTED])
IBM Java technology centre, UK.

---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to