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

Remi Forax forax at univ-mlv.fr
Wed Nov 22 16:45:15 UTC 2017


I think i prefer toImmutableList() than toUnmodifiableList() because the List is truly immutable and not an unmodifiable proxy in front of a mutable List (like Collections.unmodifiableList() does).

Rémi

----- Mail original -----
> De: "Stephen Colebourne" <scolebourne at joda.org>
> À: "core-libs-dev" <core-libs-dev at openjdk.java.net>
> Envoyé: Mercredi 22 Novembre 2017 16:42:56
> Objet: Re: RFR(m): 8177290 add copy factory methods for unmodifiable List, Set, Map

> On 19 November 2017 at 03:34, John Rose <john.r.rose at oracle.com> wrote:
>> Meanwhile, `toUnmodifiableList` is so ugly to the ear,
>> eye, and fingers that it will be less used just because of
>> its long spelling.
> 
> Many developers are already using Google Guava which has added
> toImmutableList() and friends. More widely, we use the toXxx() form
> for all the collectors we've written (in OpenGamma Strata). As such, I
> think the toXxx() naming is well established at this point, and
> toUnmodifiableList() will be fine.
> 
> Stephen


More information about the core-libs-dev mailing list