Skip to content

Conversation

@leeyikjiun
Copy link

This resolves #1957 by providing the tryParseUnsigned* methods.

@leeyikjiun
Copy link
Author

Okay, I will make the changes. Do I have to close this pull request and create a new one?

@lowasser
Copy link
Contributor

lowasser commented Oct 8, 2015

I don't think so? I think you can just add more changes to this pull request?

@leeyikjiun
Copy link
Author

I can't add the tryParse method for UnsignedBytes as there is no UnsignedByte class to return as a null object.

@lowasser
Copy link
Contributor

lowasser commented Oct 8, 2015

Then probably leave it out -- it's not clear what we should do there.

@leeyikjiun
Copy link
Author

I've found some further inconsistencies. In UnsignedLongs.parseUnsignedLong, a NumberFormatException is thrown if the radix is not within the min or max radix which is consistent with Java's Long.parseLong. However, in Longs.tryParse, an IllegalArgumentException is thrown instead.

I think the new tryParse methods should throw NumberFormatException as well. But what should we do with the old methods?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

tryParseUnsigned*

4 participants