Please review - 6984084 - String repeat()

Mikael Vidstedt mikael.vidstedt at oracle.com
Wed Aug 15 17:00:35 PDT 2012


A tiny comment on the documentation of String.repeat():

* @return a reference to this String

Given that the method returns a brand new String it should probably 
reflect that more clearly.

Cheers,
Mikael

On 8/15/2012 11:41 AM, Jim Gish wrote:
> Please review http://cr.openjdk.java.net/~jgish/6984084-StringRepeat/
>
> This in response to an old RFE to add either a new constructor or a
> method to repeat a string, such as "*".repeat(5) resutling in "*****"
>
> There is nothing particularly lambda related in here other then the fact
> that under the covers I'm using StringJoiner.
>
> I'm happy with the name "repeat" but question the "addNcopies" method in
> AbstractStringBuilder -- suggestions welcome.
>
> Thanks,
>      Jim
>
> -- Jim Gish | Consulting Member of Technical Staff | +1.781.442.0304
> Oracle Java Platform Group | Core Libraries Team 35 Network Drive
> Burlington, MA 01803 jim.gish at oracle.com
>



More information about the lambda-dev mailing list