-
Bug
-
Resolution: Duplicate
-
P3
-
None
-
8
JDK8 b93 specification on j.u.List.spliterator()
http://download.java.net/jdk8/docs/api/java/util/List.html#spliterator()
says:
"The Spliterator reports [...] Spliterator.ORDERED."
this is not so for spliterator returned by method
Collections.emptyList().spliterator()
--------------------------------------
import java.util.Collections;
import java.util.Spliterator;
public class Bug {
public static void main(String[] args) {
System.out.println("ordered = " +
Collections.emptyList().spliterator().hasCharacteristics(Spliterator.ORDERED));
}
}
--------------------------------------
will print out:
ordered = false
The following JCK tests will fail due to this issue:
api/java_util/Collections/empty/index.html#EmptyListSpliterator[hasCharacteristics_ORDERED]
api/java_util/Collections/empty/index.html#EmptyListSpliterator[characteristics_ORDERED]
api/java_util/Collections/empty/index.html#EMPTY_LISTSpliterator[hasCharacteristics_ORDERED]
api/java_util/Collections/empty/index.html#EMPTY_LISTSpliterator[characteristics_ORDERED]
http://download.java.net/jdk8/docs/api/java/util/List.html#spliterator()
says:
"The Spliterator reports [...] Spliterator.ORDERED."
this is not so for spliterator returned by method
Collections.emptyList().spliterator()
--------------------------------------
import java.util.Collections;
import java.util.Spliterator;
public class Bug {
public static void main(String[] args) {
System.out.println("ordered = " +
Collections.emptyList().spliterator().hasCharacteristics(Spliterator.ORDERED));
}
}
--------------------------------------
will print out:
ordered = false
The following JCK tests will fail due to this issue:
api/java_util/Collections/empty/index.html#EmptyListSpliterator[hasCharacteristics_ORDERED]
api/java_util/Collections/empty/index.html#EmptyListSpliterator[characteristics_ORDERED]
api/java_util/Collections/empty/index.html#EMPTY_LISTSpliterator[hasCharacteristics_ORDERED]
api/java_util/Collections/empty/index.html#EMPTY_LISTSpliterator[characteristics_ORDERED]
- duplicates
-
JDK-8022797 Clarify spliterator characteristics for collections containing no elements
- Closed