JDK-7129185 : (coll) Please add Collections.emptyNavigableSet()
  • Type: Enhancement
  • Component: core-libs
  • Sub-Component: java.util:collections
  • Affected Version: 8
  • Priority: P4
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2012-01-11
  • Updated: 2020-05-01
  • Resolved: 2013-07-12
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8
8 b100Fixed
Related Reports
Blocks :  
Duplicate :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Description
I request having a method emptyNavigableSet in Collections. I right now have a function with a parameter type 
SortedSet, and I want to provide it with an empty set.

Comments
Core-libs-dev review threads: http://mail.openjdk.java.net/pipermail/core-libs-dev/2012-January/009010.html http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-April/016480.html http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-May/016721.html http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-June/017775.html
01-05-2020

http://cr.openjdk.java.net/~mduigou/JDK-7129185/1/webrev/
02-06-2013

fix underway.
18-03-2013

Notes from meeting on 30 Aug 2012 with Mike Duigou, Stuart Marks, and Joe Darcy. - Three wrappers and two factories are missing: checkedNavigableSet synchronizedNavigableSet unmodifiableNavigableSet emptyNavigableSet singletonNavigableSet - No need to do them all. They're all independent of each other and we can choose to do or not do them in any combination, except if we implement Mike's proposal - Mike's proposal: implement unmodifiableNavigableSet. Then emptyNavigableSet is simply a TreeSet with no elements, wrapped with the unmodifiable wrapper. - implementation should be to "upgrade" the unmodifiableSortedSet wrapper class to be navigable. All of unmodifiableNavigableSet, unmodifiableSortedSet, and unmodifiableSet should be able to share this wrapper. - Issues: - sharing a single instance of emptyNavigableSet - serialization vs maintaining singleton-ness - behavior of pollFirst/pollLast - modify spec of NavigableSet.pollFirst/Last: add throws UnsupportedOperationException? - consider empty/unmodifiableNavigableMap
19-12-2012