TimurMahammadov / google-collections

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

Appendable Join.join(Appendable appendable, String delimiter, ... ) #22

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hi,

Since the Javadoc of the method says it returns "The same appendable instance 
that was passed 
in", I was wondering why the signature for the join methods was not something 
like:

public static <T extends Appendable> T join(T appendable, String delimiter, ...)

This signature ensures that the return type will be of the same type than the 
parameter.
This means that if I use a StringBuffer as input, I will get a StringBuffer as 
return value and not an 
Appendable (that need to be casted to StringBuffer :( ).

What do you think about that?

Original issue reported on code.google.com by romain.r...@gmail.com on 27 Oct 2007 at 10:50

GoogleCodeExporter commented 9 years ago
Hmm.  Why, I can't remember whether we ever thought about that or not!  We'll 
try it
out and I hope it works.  It works for Preconditions.checkNotNull, so...

thanks.

Original comment by kevin...@gmail.com on 27 Oct 2007 at 3:07

GoogleCodeExporter commented 9 years ago
CL 6316681...

Original comment by limpbizkit on 25 Jan 2008 at 7:33

GoogleCodeExporter commented 9 years ago
Fixed internally. 

Original comment by limpbizkit on 25 Jan 2008 at 9:59