RFR: 8071571: Move substring of same string to slow path

Ivan Gerasimov ivan.gerasimov at oracle.com
Tue May 12 18:58:44 UTC 2015


On 12.05.2015 20:34, Martin Buchholz wrote:
> Hi Ivan,
>
> The code below looks wrong to me - sb.length() resolves to sb.count, 
> not v2.length.
> If I'm correct, then there's a missing test to be added, since this 
> error should be caught by some test.
>       private boolean nonSyncContentEquals(AbstractStringBuilder sb) {
> -        char v1[] = value;
> -        char v2[] = sb.getValue();
> +        char[] v1 = value;
> +        char[] v2 = sb.getValue();
>           int n = v1.length;
> -        if (n != sb.length()) {
> +        if (n != v2.length) {
>               return false;
>           }
>
Yes, of course you're right.  This change looked so "obviously correct" 
to me, that I didn't care to run the tests before posting the webrev :-(

I've reverted this change back:
http://cr.openjdk.java.net/~igerasim/8071571/01/webrev/

Sincerely yours,
Ivan

>
> On Mon, May 11, 2015 at 1:52 PM, Ivan Gerasimov 
> <ivan.gerasimov at oracle.com <mailto:ivan.gerasimov at oracle.com>> wrote:
>
>     I have to take over this fix.
>
>     The latest webrev from the review thread above (with a few minor
>     changes) is here:
>     http://cr.openjdk.java.net/~igerasim/8071571/00/webrev/
>     <http://cr.openjdk.java.net/%7Eigerasim/8071571/00/webrev/>
>
>     Would you please review/approve the fix at your convenience?
>
>     Sincerely yours,
>     Ivan
>
>




More information about the core-libs-dev mailing list