Skip to content

Conversation

johnjaylward
Copy link
Contributor

Fixes #187 -0 now returns as a double.

@johnjaylward
Copy link
Contributor Author

test cases submitted

@stleary
Copy link
Owner

stleary commented Jan 28, 2016

What problem does this code solve?
Parser should follow the JSON spec and produce numeric values from '-0' and '-0.0'
This is a user-found defect. See issue #187.

Changes to the API?
XML.stringToValue(String) is deprecated in favor of JSONObject.stringToValue(String)

Changes to how the code behaves?
Negative zero strings are now parsed to Double instead of String.

Does it break the unit tests?
No, but new unit tests will be committed after this code is committed. See stleary/JSON-Java-unit-test#39.

Will this require a new release?
No, I am proposing for this change to be rolled into the next release. If you disagree, please
post in this thread

Should the documentation be updated?
No.

@johnjaylward
Copy link
Contributor Author

-0 and -0.0 both parse to Double since Long/Integer would lose the sign.

@stleary
Copy link
Owner

stleary commented Jan 28, 2016

Got it, thanks.

@coderextreme
Copy link

This fixed over 6300 instances in our JSON documents. Thanks everyone for the effort.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants