JSON-java icon indicating copy to clipboard operation
JSON-java copied to clipboard

Problem with optLong, getLong when parsing JSONObject and XML

Open stleary opened this issue 1 year ago • 3 comments

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 avatar Feb 24 '24 17:02 stleary