Re: [classlib][luni] Suspicious behavior of java.util.EnumSet

2006-08-21 Thread Leo Li
In my opinion, it is just RI' s implementation and it is up to you as a developer to make the choice.:) On 8/21/06, Spark Shen <[EMAIL PROTECTED]> wrote: Leo Li 写道: > If so, we cannot regard it as RI's bug. And I believe the size of 64 > and the > existence of the deleted element depends on RI'

Re: [classlib][luni] Suspicious behavior of java.util.EnumSet

2006-08-21 Thread Spark Shen
Leo Li 写道: > If so, we cannot regard it as RI's bug. And I believe the size of 64 > and the > existence of the deleted element depends on RI's algorithm especially it > does not provide concurrent assurance. Maybe it is due to performance > concerns, I am not sure. > The curious thing is whether we

Re: [classlib][luni] Suspicious behavior of java.util.EnumSet

2006-08-21 Thread Paulex Yang
Spark Shen wrote: But, do you agree to following RI on this strange behavior? Personally, I think throw an IllegalStateException here is more appropriate. The spec for Iterator.remove() says: "Throws ||IllegalStateException - if the next method has not yet been called, or the remove method

Re: [classlib][luni] Suspicious behavior of java.util.EnumSet

2006-08-20 Thread Leo Li
If so, we cannot regard it as RI's bug. And I believe the size of 64 and the existence of the deleted element depends on RI's algorithm especially it does not provide concurrent assurance. Maybe it is due to performance concerns, I am not sure. The curious thing is whether we should behave as RI s

Re: [classlib][luni] Suspicious behavior of java.util.EnumSet

2006-08-20 Thread Spark Shen
Leo Li 写道: Hi, Spark: Yes, I think it is RI's bug. But It should throw ConcurrentModificationException as spec says: 1. This exception may be thrown by methods that have detected concurrent modification of an object when such modification is not permissible. 2. Note that this exception does not a

Re: [classlib][luni] Suspicious behavior of java.util.EnumSet

2006-08-20 Thread Spark Shen
Jimmy, Jing Lv 写道: Spark Shen wrote: Hi All: The following behavior of RI java.util.EnumSet seems odd. Do you have any opinion on whether it is a bug of RI? import java.util.EnumSet; import java.util.Iterator; public class Test { static enum EnumFoo { a, b, } public static void main(String[]

Re: [classlib][luni] Suspicious behavior of java.util.EnumSet

2006-08-20 Thread Jimmy, Jing Lv
Spark Shen wrote: Hi All: The following behavior of RI java.util.EnumSet seems odd. Do you have any opinion on whether it is a bug of RI? import java.util.EnumSet; import java.util.Iterator; public class Test { static enum EnumFoo { a, b, } public static void main(String[] ar

Re: [classlib][luni] Suspicious behavior of java.util.EnumSet

2006-08-20 Thread Leo Li
Hi, Spark: Yes, I think it is RI's bug. But It should throw ConcurrentModificationException as spec says: 1. This exception may be thrown by methods that have detected concurrent modification of an object when such modification is not permissible. 2. Note that this exception does n

[classlib][luni] Suspicious behavior of java.util.EnumSet

2006-08-19 Thread Spark Shen
Hi All: The following behavior of RI java.util.EnumSet seems odd. Do you have any opinion on whether it is a bug of RI? import java.util.EnumSet; import java.util.Iterator; public class Test { static enum EnumFoo { a, b, } public static void main(String[] args){ EnumSet