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

roger riggs roger.riggs at oracle.com
Thu Aug 14 13:15:14 UTC 2014


Hi,

My preference would be to keep the offsets immediately following the 
CharSequence,
that clearly identifies the substring being operated on.

Roger


On 8/14/2014 8:00 AM, Alan Bateman wrote:
> 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