-
Bug
-
Resolution: Duplicate
-
P3
-
None
-
8
JDK8 b93 specification on j.u.Set.spliterator()
http://download.java.net/jdk8/docs/api/java/util/Set.html#spliterator()
says:
"The Spliterator reports [...] Spliterator.DISTINCT."
this is not so for spliterator returned by method
Collections.emptySet().spliterator()
-----------------------------------------
import java.util.Collections;
import java.util.Spliterator;
public class Bug {
public static void main(String[] args) {
System.out.println("distinct = " +
Collections.emptySet().spliterator().hasCharacteristics(Spliterator.DISTINCT));
}
}
-----------------------------------------
will print out:
distinct = false
The following JCK tests will fail due to this issue:
api/java_util/Collections/empty/index.html#EmptySetSpliterator[hasCharacteristics_DISTINCT]
api/java_util/Collections/empty/index.html#EmptySetSpliterator[characteristics_DISTINCT]
api/java_util/Collections/empty/index.html#EMPTY_SETSpliterator[hasCharacteristics_DISTINCT]
api/java_util/Collections/empty/index.html#EMPTY_SETSpliterator[characteristics_DISTINCT]
http://download.java.net/jdk8/docs/api/java/util/Set.html#spliterator()
says:
"The Spliterator reports [...] Spliterator.DISTINCT."
this is not so for spliterator returned by method
Collections.emptySet().spliterator()
-----------------------------------------
import java.util.Collections;
import java.util.Spliterator;
public class Bug {
public static void main(String[] args) {
System.out.println("distinct = " +
Collections.emptySet().spliterator().hasCharacteristics(Spliterator.DISTINCT));
}
}
-----------------------------------------
will print out:
distinct = false
The following JCK tests will fail due to this issue:
api/java_util/Collections/empty/index.html#EmptySetSpliterator[hasCharacteristics_DISTINCT]
api/java_util/Collections/empty/index.html#EmptySetSpliterator[characteristics_DISTINCT]
api/java_util/Collections/empty/index.html#EMPTY_SETSpliterator[hasCharacteristics_DISTINCT]
api/java_util/Collections/empty/index.html#EMPTY_SETSpliterator[characteristics_DISTINCT]
- duplicates
-
JDK-8022797 Clarify spliterator characteristics for collections containing no elements
- Closed
- relates to
-
JDK-8016777 Collections.emptyMap().[keySet()/entrySet()].spliterator() doesn't report DISTINCT
- Closed