On 14 October 2015 at 18:56, Kevin Bourrillion <kev...@google.com> wrote:
> Note that we have empirically learned through our Lists/Sets/Maps factory
> classes that varargs factory methods for mutable collections are almost
> entirely useless.

Having taken a few days to think it over, I reluctantly think that
Kevin is right. Particularly as static methods on classes are
inherited, as Remi says. If someone needs a mutable one, they can
simply write:

new ArrayList<>(List.of(z, b, c))

Adding immutable implementations just on the interfaces seems like a
reasonable balancing point, and provides more API room to add the
IntFunction version I mentioned ;-)

As a side note, a really nice language change would be to deprecate
the ability to refer to static methods from subclasses or instance
variables in the JLS.

Stephen

Reply via email to