Skip to content
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

Problem with optLong, getLong when parsing JSONObject and XML #868

Open
stleary opened this issue Feb 24, 2024 · 1 comment
Open

Problem with optLong, getLong when parsing JSONObject and XML #868

stleary opened this issue Feb 24, 2024 · 1 comment

Comments

@stleary
Copy link
Owner

stleary commented Feb 24, 2024

This issue tracks the history and next steps for some recent issues and PRs concerning different handling for optLong and getLong in JSONObject and XML.

#653 noted that JSONObject optLong() and getLong() have different behaviors.
#783 fixed the JSONObject issue in #653.
#790 was added to discuss a similar problem in XML parsing.
#794 fixed the XML issue in #790.
#826 raised an issue that there were problems with the change to JSONObject (see #653 and #783)
#852 raised an issue that there were problems with the change to XML (see #790 and #794)

#661 was another attempt at fixing #653. It was ultimately not accepted, but illustrates the difficulty in getting the expected behavior.

There was insufficient care in the code review to ensure the changes had no unintended side effects. Also, these behavior changes should probably have been opt-in via a configuration object, rather than made unilaterally for all users.
The changes in #783 and #794 will be reverted. At some future time, we should address this issue again, but without the side effects.

#814 will be reverted as well (see #813), since it touches code that is being reverted.

@stleary
Copy link
Owner Author

stleary commented Mar 3, 2024

The code has been reverted in release 20240303. There is still a need to address the original problem: getLong() and optLong() should return consistent results.

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

No branches or pull requests

1 participant