RFR : 7129185 : Add Collections.{checked|empty|unmodifiable}Navigable{Map|Set} (original) (raw)
Mike Duigou mike.duigou at oracle.com
Tue May 7 15:46:14 UTC 2013
- Previous message: RFR : 7129185 : Add Collections.{checked|empty|unmodifiable}Navigable{Map|Set}
- Next message: hg: jdk8/tl/langtools: 8014023: When a method reference to a local class constructor is contained in a method whose number of parameters matches the number of constructor parameters compilation fails
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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.duigou at 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 at 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 uts = Collections.unmodifiableNavigableSet(new TreeSet()) and Set 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
- Previous message: RFR : 7129185 : Add Collections.{checked|empty|unmodifiable}Navigable{Map|Set}
- Next message: hg: jdk8/tl/langtools: 8014023: When a method reference to a local class constructor is contained in a method whose number of parameters matches the number of constructor parameters compilation fails
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]