RFR: JDK-8197594: String#repeat
James Laskey
james.laskey at oracle.com
Thu Mar 1 02:34:02 UTC 2018
Thanks Stuart. RE apinote, I was trying to follow the pattern of other older method comments (Roman-style.) Comments/Javadoc in most of these older classes are a mix of styles. Question: if you update/clean-up a method in an older class, should you bring the comment/Javadoc up-to-date as well?
Cheers,
— Jim
Sent from my iPhone
> On Feb 28, 2018, at 6:21 PM, Stuart Marks <stuart.marks at oracle.com> wrote:
>
> Hi Jim,
>
> Implementation looks good. I'd suggest a couple small editorial changes to the spec:
>
> 2966 /**
> 2967 * Returns a string whose value is the concatenation of this
> 2968 * string repeated {@code count} times.
> 2969 * <p>
> 2970 * If count or length is zero then the empty string is returned.
>
> I went looking for a 'length' parameter, until I realized it means the length of *this string*. So maybe clarify that. (And also line 2977.)
>
> 2971 * <p>
> 2972 * This method may be used to create space padding for
> 2973 * formatting text or zero padding for formatting numbers.
>
> I don't think having this text is necessary, but if you want it, I'd suggest putting it into an @apiNote.
>
> 2974 * @param count number of times to repeat
> 2975 * @return A string composed of this string repeated
> 2976 * {@code count} times or the empty string if count
> 2977 * or length is zero.
>
> Thanks,
>
> s'marks
>
>
>> On 2/28/18 8:31 AM, Jim Laskey wrote:
>> Introduction of a new instance method String::repeat to allow an efficient and concise approach for generating repeated character sequences as strings.
>> Performance information in JBS.
>> Thank you.
>> Cheers,
>> — Jim
>> JBS: https://bugs.openjdk.java.net/browse/JDK-8197594 <https://bugs.openjdk.java.net/browse/JDK-8197594>
>> CSR: https://bugs.openjdk.java.net/browse/JDK-8198296
>> <http://cr.openjdk.java.net/~jlaskey/8197594/String.html>
>> Webrev: http://cr.openjdk.java.net/~jlaskey/8197594/webrev-02/index.html <http://cr.openjdk.java.net/~jlaskey/8197594/webrev-02/index.html>
>> JavaDoc: http://cr.openjdk.java.net/~jlaskey/8197594/String.html <http://cr.openjdk.java.net/~jlaskey/8197594/String.html>
More information about the core-libs-dev
mailing list