Re: [classlib][luni] A problem about behavior of EnumMap

2006-08-29 Thread Spark Shen
Paulex Yang 写道: Spark Shen wrote: Spark Shen 写道: I guess on RI, the returned iterator maintains a reference to current entry and returns this reference in iter.next() method. I do not think RI's behavior makes sense here. So I suggest not to follow RI on the behavior. I want to adopt the beh

Re: [classlib][luni] A problem about behavior of EnumMap

2006-08-29 Thread Paulex Yang
Spark Shen wrote: Spark Shen 写道: I guess on RI, the returned iterator maintains a reference to current entry and returns this reference in iter.next() method. I do not think RI's behavior makes sense here. So I suggest not to follow RI on the behavior. I want to adopt the behavior described b

Re: [classlib][luni] A problem about behavior of EnumMap

2006-08-29 Thread Spark Shen
Spark Shen 写道: I guess on RI, the returned iterator maintains a reference to current entry and returns this reference in iter.next() method. I do not think RI's behavior makes sense here. So I suggest not to follow RI on the behavior. I want to adopt the behavior described below because it see

Re: [classlib][luni] A problem about behavior of EnumMap

2006-08-29 Thread Tony Wu
I found all of the previous entrys will be set to current one while iter.next() was invoked. so I guess there is just the same instance returned by iter.next() with variable modifications. It is a bug if not a trade-off for performance I think. On 8/28/06, Spark Shen <[EMAIL PROTECTED]> wrote:

Re: [classlib][luni] A problem about behavior of EnumMap

2006-08-29 Thread Paulex Yang
Spark Shen wrote: Hi All: When I develop EnumMap,I find EnumMap strange on RI. As the following code describes, the method entrySet() of EnumMap returns a set view of mappings contained in this map. Then we get the set's iterator and use the iterator's next() method to get an Entry which conta

Re: [classlib][luni] A problem about behavior of EnumMap

2006-08-29 Thread Stepan Mishura
On 8/28/06, Spark Shen wrote: Hi All: When I develop EnumMap,I find EnumMap strange on RI. As the following code describes, the method entrySet() of EnumMap returns a set view of mappings contained in this map. Then we get the set's iterator and use the iterator's next() method to get an Entry w

[classlib][luni] A problem about behavior of EnumMap

2006-08-28 Thread Spark Shen
Hi All: When I develop EnumMap,I find EnumMap strange on RI. As the following code describes, the method entrySet() of EnumMap returns a set view of mappings contained in this map. Then we get the set's iterator and use the iterator's next() method to get an Entry which contains one mapping. B