RFR(m): 8177290 add copy factory methods for unmodifiable List, Set, Map

Stuart Marks stuart.marks at oracle.com
Thu Sep 21 18:55:54 UTC 2017

On 9/21/17 5:42 AM, Alan Bateman wrote:
> On 21/09/2017 01:02, Stuart Marks wrote:
>>     http://cr.openjdk.java.net/~smarks/reviews/8177290/webrev.0/
> I read through the updated/new definitions and they read well.


> For the copyOf methods then I can't immediately tell from the javadoc if the
> given collection can contain null elements. Taking List.copyOf as an example
> where coll may be null or it may contain null elements. The javadoc does link to
> "Unmodifiable lists" where it specifies the characteristics of the lists
> returned by the static factory methods - these include disallowing null
> elements. So I think this needs to be clarified.

Agreed, I'll work on some clarifications here, and also disallow null for the 
argument itself.

> Minimal implementation is okay to get started but what is the reason not to
> include some basic tests?

Sorry, I should have been more clear about this. The changeset is clearly not 
ready to go in as it stands. I wanted to get an initial review of the 
specifications going, then file a CSR request, etc. while continuing to work on 
tests and better implementations. I'll post a subsequent review when they're ready.



More information about the core-libs-dev mailing list