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

Bugfix in JSONObject.Similar() #611

Closed
eyalb40 opened this issue Jul 12, 2021 · 4 comments
Closed

Bugfix in JSONObject.Similar() #611

eyalb40 opened this issue Jul 12, 2021 · 4 comments

Comments

@eyalb40
Copy link

eyalb40 commented Jul 12, 2021

I JSONObject.Similar() you return true\false after comparing a number property. Should only return if false.

Should replace
return isNumberSimilar((Number)valueThis, (Number)valueOther);
with
if (!isNumberSimilar((Number)valueThis, (Number)valueOther))
return false;

@johnjaylward
Copy link
Contributor

@stleary
Copy link
Owner

stleary commented Jul 13, 2021

Agreed, good catch @eyalb40, and thanks for the heads-up. Feel free to submit a pull request to fix this, if you want.

@stleary
Copy link
Owner

stleary commented Jul 18, 2021

Fixed in #613

@stleary stleary closed this as completed Jul 18, 2021
@johnjaylward
Copy link
Contributor

@stleary, you should also correct the similar in JSONArray

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

No branches or pull requests

3 participants