[9] RFR 8055251: Re-examine Integer.parseInt and Long.parseLong methods

Remi Forax forax at univ-mlv.fr
Wed Sep 10 12:41:34 UTC 2014

On 09/10/2014 01:55 PM, Claes Redestad wrote:
> On 09/05/2014 03:49 PM, Alan Bateman wrote:
>> On 05/09/2014 14:03, Claes Redestad wrote:
>>> Hi,
>>> I'm requesting reviews and a sponsor for these changes to the recently
>>> added parse methods (8041972), suggested during discussions on net-dev:
>>> bug: https://bugs.openjdk.java.net/browse/JDK-8055251
>>> webrev: http://cr.openjdk.java.net/~redestad/8055251/webrev.1/
>> Thanks for doing this, I think the API is much better now and much 
>> less error prone.
>> The drive-by fix to the index in the NumberFormatException also looks 
>> good.
> Thanks!
> /Claes

Looks good to me,
nitpicking, line 672 of Long.java, I think it's better to use a for 
instead of a while,
the incrementation will be more obvious.

Also, but it's not fully related to this patch, the first line of 
parseInt/parseLong(CharSequence, int, int, int)
is uncommon,
   s = Objects.requireNonNull(s);
can be simplified to


>> -Alan.

More information about the core-libs-dev mailing list