RFR: JDK-8197594: String#repeat

Jim Laskey james.laskey at oracle.com
Thu Mar 1 20:37:48 UTC 2018


Ivan,

The code is now checked in if you want to test.

Cheers,

— Jim


> On Mar 1, 2018, at 4:20 PM, Ivan Gerasimov <ivan.gerasimov at oracle.com> wrote:
> 
> Hi Jim!
> 
> I think the copying-loop can be slightly simplified, like this:
> 
>     for (; copied < limit - copied; copied <<= 1) {
>         System.arraycopy(multiple, 0, multiple, copied, copied);
>     }
> 
> (didn't actually run it to check for correctness.)
> 
> With kind regards,
> Ivan
> 
> 
> 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> <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 <https://bugs.openjdk.java.net/browse/JDK-8198296>
>>  <http://cr.openjdk.java.net/~jlaskey/8197594/String.html> <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> <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> <http://cr.openjdk.java.net/~jlaskey/8197594/String.html> <http://cr.openjdk.java.net/~jlaskey/8197594/String.html>
>> 
>> 
>> 
>> 
> 
> -- 
> With kind regards,
> Ivan Gerasimov



More information about the core-libs-dev mailing list