RFR(S): 8055032: Improve numerical parsing in java.net and sun.net

Alan Bateman Alan.Bateman at oracle.com
Thu Aug 14 12:00:30 UTC 2014


On 14/08/2014 12:42, Claes Redestad wrote:
>
> Noone brought it up, as far as I can recall. Since parseInt(String, 
> int radix) already existed, I figured adding the range parameters to 
> the end would be overall less awkward than to push the radix parameter 
> right in the new methods. The chosen implementation maintains that the 
> second parameter is always radix, which I think helps maintain 
> consistency.
I think consistency could be argued both ways as the radix is also the 
last parameter in the existing methods. When I look at this method:

public static int parseInt(CharSequence s, int radix, int beginIndex, 
int endIndex)

and then feels more error prone than if the beginIndex/endIndex were 
immediately after the CharSequence.

I'm interested in other opinions on this.

-Alan.


More information about the net-dev mailing list