Closed GoogleCodeExporter closed 9 years ago
I like that. And of course there should be similar factory methods for all the
ImmutableCollection+ builders.
Original comment by SeanPFl...@googlemail.com
on 12 Oct 2012 at 10:05
A few years back, we had a long discussion about this. We are not a fan of
having to write "new ImmutableMap.Builder<String, String>," so we liked the
idea of builder(K, V) to stamp it out. In the end, though, we couldn't
ourselves that it was worth making it more marginally difficult to read and
modify existing code:
.builder("a", "b")
.put("c", "d")
.put("e", "f")
First, it looks a little ragged. Second, removing the first line now requires
changes to two lines:
.builder("c", "d")
.put("e", "f")
We're not certain that we made the right choice, but I think we've spent enough
on the discussion that we've put this to bed.
Maybe, though, we should be looking to increase the number of "fake varargs"
supported by ImmutableMap.of()?
Original comment by cpov...@google.com
on 12 Oct 2012 at 3:59
Original comment by wasserman.louis
on 12 Oct 2012 at 4:06
Hmm, maybe we really should go ahead and turn those fake varargs up to 11 like
the others? I despise what it does to the javadoc, but we decided to live with
that elsewhere.
Original comment by kevinb@google.com
on 12 Oct 2012 at 5:37
This issue has been migrated to GitHub.
It can be found at https://github.com/google/guava/issues/<id>
Original comment by cgdecker@google.com
on 1 Nov 2014 at 4:13
Original comment by cgdecker@google.com
on 3 Nov 2014 at 9:08
Original issue reported on code.google.com by
MrChrisP...@googlemail.com
on 12 Oct 2012 at 9:46