RFR (S) 8136500: Integer/Long getChars and stringSize should be more idiomatic
Aleksey Shipilev
aleksey.shipilev at oracle.com
Mon Nov 23 21:42:07 UTC 2015
On 11/23/2015 08:58 PM, John Rose wrote:
> On Nov 23, 2015, at 8:23 AM, Ivan Gerasimov <ivan.gerasimov at oracle.com
> <mailto:ivan.gerasimov at oracle.com>> wrote:
>>
>> Though, it may be better to get yet another pair of eyes.
>>
>> One minor nit: In the tests, in the summary, it is written, "Test
>> Integer.toString method*s*", but only one of the overloads is tested.
>
> Here's another nit in the tests.
> This is supposed to "wiggle around" critical points, which I agree with.
> But it only wiggles above:
>
> 39 while (base < Long.MAX_VALUE / 10) {
> 40 for (int c = 1; c < 65536; c++) {
> 41 buildAndTest(base + c);
> 42 }
> 43 base = (base == 0) ? 1 : base * 10;
> 44 }
>
> I suggest: for (int c = -1<<15; c <= 1<<15; c++)
>
> You'll need to guard the call to buildAndTest to avoid negatives.
> You could also start base at, say, 10000.
Okay, here it is (only tests changed):
http://cr.openjdk.java.net/~shade/8136500/webrev.06/
Thanks,
-Aleksey
More information about the core-libs-dev
mailing list