Closed GoogleCodeExporter closed 9 years ago
These methods were removed in revision 47, which came before the 20080818
release.
ImmutableList, ImmutableSet, etc. now feature the overloads you've requested.
Original comment by cpov...@google.com
on 23 Jun 2009 at 4:54
Thanks for the response, but I don't see the methods that I've requested in
ImmutableList or ImmutableSet. They only have the singleton case and the
varargs case,
not the N in 2..10 cases. Please re-open, or close on different grounds. Thanks.
Original comment by jaredjac...@gmail.com
on 23 Jun 2009 at 5:48
I believe the 'of(...)' methods do what you want:
http://code.google.com/p/google-collections/source/browse/trunk/src/com/google/
common/collect/ImmutableList.java
See methods:
public static <E> ImmutableList<E> of(E e1, E e2)
public static <E> ImmutableList<E> of(E e1, E e2, E e3)
...
and similar in ImmutableSet.
Original comment by cresw...@gmail.com
on 23 Jun 2009 at 5:59
Revisions 57, also part of the 20080818 release, added the methods to
ImmutableList.
I see that I'm wrong about ImmutableSet, and now that you mention it, I don't think
we ever decided whether to supply these methods for all the Immutable* classes
or how
many arguments to support.
Original comment by cpov...@google.com
on 23 Jun 2009 at 6:05
Original comment by cpov...@google.com
on 23 Jun 2009 at 6:06
> or how many arguments to support.
Please support more than now - at least 20 if you ask me.
It's very annoying to reformat the code to use the builder pattern if you add
the 7th
constant to a list.
I was wondering whether or not to make this a separate issue.
Original comment by zeitlin...@gmail.com
on 1 Jul 2009 at 8:14
You don't _have_ to reformat the code; you could just prepend
@SuppressWarnings("unchecked") // stupid varargs warning
No matter where we cut off these overloads, someone will always be just over
the line
and will wonder why we don't add just a few more; to stave off all that
insanity we
decided to keep it to five.
We will probably make ImmutableList.of() the lone exception, and equip it with
numerous overloads (to a point), so that it can be your go-to "turn varargs
into a
collection warning-free" method.
Original comment by kevin...@gmail.com
on 1 Jul 2009 at 5:05
In leaving my last comment, I forgot to notice that indeed, we HAVE forgotten
to add
the of(E, E)-style overloads going up to 5. I argued against going further
than 5,
but I thought we had gone up to 5 already. We will fix this.
Original comment by kevin...@gmail.com
on 7 Aug 2009 at 6:26
Fixed for next RC.
Original comment by kevin...@gmail.com
on 12 Aug 2009 at 5:03
Great! Thanks Kevin.
Original comment by jaredjac...@gmail.com
on 14 Aug 2009 at 7:06
Original issue reported on code.google.com by
jaredjac...@gmail.com
on 23 Jun 2009 at 4:40