Good suggestion, thank you.

Mike

On May 7 2013, at 06:36 , Jason Mehrens wrote:

> Mike,
> 
> EmptyNavigableMap and EmptyNavigableSet should contain the static final 
> references themselves and not the Collections class.  That way they load on 
> demand and not with the Collections class.  Use default visibility inside the 
> inner class so the compiler doesn't generate method to promote access. See 
> the EmptyIterator class.
> 
> Jason
> 
> 
> ----------------------------------------
>> From: mike.dui...@oracle.com
>> Subject: RFR : 7129185 : Add 
>> Collections.{checked|empty|unmodifiable}Navigable{Map|Set}
>> Date: Mon, 29 Apr 2013 18:54:19 -0700
>> To: core-libs-dev@openjdk.java.net
>> 
>> Hello all;
>> 
>> This is a non-integration code review. I am picking this patch up after 
>> ignoring it for most of the last year. I've recently expanded the regression 
>> tests to, I believe, handle almost all of the new code paths added by this 
>> patch.
>> 
>> http://cr.openjdk.java.net/~mduigou/JDK-7129185/0/webrev/
>> 
>> This issue is a follow-on to JDK-4533691 which added emptySortedSet(). In 
>> addition to adding support for NavigableSet/Map this patch also corrects 
>> differences between the behaviour of:
>> 
>> Set<Integer> uts = Collections.unmodifiableNavigableSet(new TreeSet())
>> 
>> and
>> 
>> Set<Integer> es = Collections.emptyNavigableSet()
>> 
>> involving bounded sub-ranges. At this point I believe that "uts" and "es" 
>> will be operationally indistinguishable. emptyNavigableSet() will still be 
>> more efficient though as it is a singleton and doesn't generally(*) consume 
>> additional resources for each instance. The asterisk next to generally comes 
>> from the bounded sub-ranges functionality. Sub ranges of empty SortedSet and 
>> NavigableSet will no longer be the singleton. They are instead instances 
>> which capture the range.
>> 
>> Because so much time has passed since this issue originally surfaced I'm 
>> concerned that I might be forgetting something. I do know that I still need 
>> to create an EmptyNavigableMap unit test and add serialversionid to all the 
>> new classes but does anything else seem to be missing either in terms of the 
>> implementation or the tests?
>> 
>> Mike                                           

Reply via email to