hisassy / google-collections

Automatically exported from code.google.com/p/google-collections
Apache License 2.0
0 stars 0 forks source link

Rename ImmutableMultiset.Builder.add(E, int) to addCopies(E, int) #263

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
The problem with the current name can be seen here:

   builder.add(1);
   builder.add(2, 3);
   builder.add(4, 5, 6);

Any other ideas for how to remove this ambiguity?

Original issue reported on code.google.com by kevin...@gmail.com on 16 Oct 2009 at 10:25

GoogleCodeExporter commented 8 years ago

Original comment by kevin...@gmail.com on 29 Oct 2009 at 6:59

GoogleCodeExporter commented 8 years ago
I'm tempted to just live with this problem, but I feel a little guilty about 
this 
temptation. Any compelling arguments?

Original comment by kevin...@gmail.com on 29 Oct 2009 at 7:04

GoogleCodeExporter commented 8 years ago
The ambiguity may occur for an ImmutableMultiset of Integers, but not for an
ImmutableMultiset containing any other type. Since that's a rather special 
case, this
issue doesn't bother me much.

Original comment by jared.l....@gmail.com on 29 Oct 2009 at 8:15

GoogleCodeExporter commented 8 years ago

Original comment by kevin...@gmail.com on 30 Oct 2009 at 5:24

GoogleCodeExporter commented 8 years ago
So that's another entry for a future version of java puzzlers :(

Original comment by jim.andreou on 30 Oct 2009 at 5:49

GoogleCodeExporter commented 8 years ago
If IntelliJ can do this in one fell swoop, I'll take care of it on Monday.  (I
started to set up a mega-client before leaving today.)  If not, so be it :\

(Or perhaps you've already tried?)

Original comment by cpov...@google.com on 31 Oct 2009 at 6:01

GoogleCodeExporter commented 8 years ago
All right, we'll try to do this. 

I wonder if addCopies() is worth considering.  While there's ambiguity to the 
word 
"copies", this does happen to be exactly the same meaning used by 
java.util.Collections.nCopies().

addMultiple() is just... bulky-seeming, even though it's only 2 characters 
longer.

Original comment by kevin...@gmail.com on 2 Nov 2009 at 10:15

GoogleCodeExporter commented 8 years ago

Original comment by kevin...@gmail.com on 9 Nov 2009 at 6:24