Details
-
Bug
-
Resolution: Fixed
-
P3
-
None
-
b105
-
Verified
Description
The spliterator for a collection containing no elements should only be required to support SIZED and need not report any additional required characteristics.
This makes it easier to share a single immutable instance of an empty spliterator for empty collections obtained from Collectionsempty* methods. Since there are no elements it does not matter if additional characteristics are not reported since they would not aid the client to "to control, specialize or simplify computation".
The reporting of SIZED is important since clients can determine if the spliterator is empty.
This makes it easier to share a single immutable instance of an empty spliterator for empty collections obtained from Collectionsempty* methods. Since there are no elements it does not matter if additional characteristics are not reported since they would not aid the client to "to control, specialize or simplify computation".
The reporting of SIZED is important since clients can determine if the spliterator is empty.
Attachments
Issue Links
- duplicates
-
JDK-8020014 Collections.nCopies(0, T).spliterator() is not ORDERED as expected
-
- Resolved
-
-
JDK-8016774 Collections.emptyList().spliterator().hasCharacteristics(Spliterator.ORDERED) returns false
-
- Resolved
-
-
JDK-8016775 Collections.emptySet().spliterator().hasCharacteristics(Spliterator.DISTINCT)) returns false
-
- Resolved
-
-
JDK-8016776 Collections.emptySortedSet().spliterator() doesn't report DISTINCT, ORDERED, SORTED
-
- Resolved
-
-
JDK-8016777 Collections.emptyMap().[keySet()/entrySet()].spliterator() doesn't report DISTINCT
-
- Resolved
-