-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update XML with recent changes for JSONObject optLong vs getLong #790
Comments
I would like to work on this |
Moved the code logic to a common utility to de-duplicate.
@stleary - I have raised a PR for this. The number conversion and potential number check is moved to a separate utility and that has been used in both parsers. |
Comments have been added to the PR |
@stleary - Adding these changes into XML is going to affect some of the existing unit test cases. e.g., /** In the comment of the test case, it is mentioned that leading zeros being removed is the expectation. But, in the test case expectation string, leading zeros are kept intact. This is caused by the present implementation, which throws NumberFormatException while parsing number with leading zeros and numbers are parsed as strings. And, when this logic will be replaced by the new implementation, numbers with leading zeros will be parsed as numbers, and will reflect in the resultant JSON object. This probably is the intended behavior. Question lies, shall we go ahead and break the existing test cases, or maintain status quo? |
@rudrajyotib Thanks for bringing this up. |
For now the code remains duplicated in JSON and XML parsers. Unit test cases updated to comply with number expectations.
Fixed in #794 |
See #783 and apply the same updates to XML.java for consistent behavior.
Post here if you have questions about how to implement the changes.
The text was updated successfully, but these errors were encountered: