----- Mail original -----
> De: "Stephen Colebourne" <[email protected]>
> À: "core-libs-dev" <[email protected]>
> Envoyé: Vendredi 9 Octobre 2015 15:11:47
> Objet: Re: RFC: draft API for JEP 269 Convenience Collection Factories
>
> On 9 October 2015 at 00:39, Stuart Marks <[email protected]> wrote:
[...]
> > 2. Other concrete collection factories.
> >
> > I've chosen to provide factories for the concrete collections ArrayList,
> > HashSet, and HashMap, since those seem to be the most commonly used. Is
> > there a need to provide factories for other concrete collections, such as
> > LinkedHashMap?
>
> LinkedHashMap definitely
> LinkedList definitely not (as its very slow and use should not be
> encouraged).
> TreeSet/TreeMap, maybe, they'd need an extra parameter though.
There is an issue with LinkedHashMap (resp LinkedHashSet),
it inherits from HashMap /facepalm/, and static methods are accessible through
class inheritance /facepalm/.
So if LinkedHashMap doesn't declare some methods of(),
LinkedHashMap.of("foo")
will return a HashMap :(
cheers,
Rémi