Re: Sponsoring getting 5015163 "(str) String merge/join that is the inverse of String.split()" into JDK 7

Wang Weijun Weijun.Wang at Sun.COM
Fri Oct 23 02:15:47 UTC 2009


Anyone will really use the single Object argument version? There's nothing 
to join here.

- Max

------- Original message -------
> From: Joe Darcy <Joe.Darcy at Sun.COM>
> Cc: core-libs-dev at openjdk.java.net
> Sent: 23.10.'09,  9:49
>
> Joe Darcy wrote:
>    public static String join(String separator, Iterable<?> objects);
>    public static String join(String separator, Object[] objects);
>    public static String join(String separator, Object first, Object... 
> rest);
>
> with analogous methods in StringBuffer and StringBuilder return that 
> type, respectively, instead of String?
>
> I assume the motivation for having both the Object[] and (Object, 
> Object...) versions is to avoid unnecessary array creation in the case of 
> one argument since the single method join(String, Object...) could also be 
> used.
>
> -Joe




More information about the core-libs-dev mailing list