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

Claes Redestad claes.redestad at oracle.com
Fri Sep 5 13:03:33 UTC 2014


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/
discussion:http://mail.openjdk.java.net/pipermail/net-dev/2014-August/008625.html

Changes:
- Removethe following methods:
Integer::parseInt(CharSequence s, int radix, int beginIndex)
Integer::parseUnsignedInt(CharSequence s, int radix, int beginIndex)
Long::parseLong(CharSequence s, int radix, int beginIndex)
Long::parseUnsignedLong(CharSequence s, int radix, int beginIndex)

- Move radix parameter to the end in the following methods:
Integer::parseInt(CharSequence s, int radix, int beginIndex, int endIndex)
Integer::parseUnsignedInt(CharSequence s, int radix, int beginIndex, int 
endIndex)
Long::parseLong(CharSequence s, int radix, int beginIndex, int endIndex)
Long::parseUnsignedLong(CharSequence s, int radix, int beginIndex, int 
endIndex)

- Change all places in the code where the methods already have been adopted
- Add some tests for parseUnsignedInt/-Long
- Ensure that when parsing fails the correct index is reported in the 
exception

/Claes



More information about the core-libs-dev mailing list