Code Review Request Bug #7129185:(coll) Please add Collections.emptyNavigableSet()
Jason Mehrens
jason_mehrens at hotmail.com
Tue Jan 24 21:29:30 UTC 2012
> > 3. What if I want to create an empty set navigable set with supplied
> > comparator? Extending is not an option.
> This is the one issue I wanted to discuss...is this necessary? I was
> thinking about how this would be implemented. You would need to supply
> a comparator to the emptyNavigableSet. Other empty* methods don't take
> parameters and adding a method to supply a comparator would require an
> additional method.
I think you have little choice but to add the parameter because the current implementation of emptyNavigableSet().descendingSet().comparator() returns the wrong value. Which should mean that the bounds checking is incorrect in the descendingSet too. Am I correct on that? So by adding that feature you don't have to create a special subclass to correctly implement EmptyNavigableSet.
Jason
More information about the core-libs-dev
mailing list