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

False positives in JSONObject.similar() and JSONArray.similar()? #379

Closed
enoes opened this issue Nov 6, 2017 · 3 comments
Closed

False positives in JSONObject.similar() and JSONArray.similar()? #379

enoes opened this issue Nov 6, 2017 · 3 comments

Comments

@enoes
Copy link

enoes commented Nov 6, 2017

I'm afraid the for-loops in the above mentioned methods are breaking to soon if only one similarity was detected, see line 1487 in JSONObject.java and 1292 in JSONArray.java. Or did I overlook something?

@enoes enoes changed the title False positives in JSONObject.similar() ans JSONArray.similar()? False positives in JSONObject.similar() and JSONArray.similar()? Nov 6, 2017
@johnjaylward
Copy link
Contributor

Yes, you did. Those lines are determining if the 2 references in memory are the same. If they are, there is no way their child objects could differ.

@johnjaylward
Copy link
Contributor

johnjaylward commented Nov 6, 2017

wait, you may be correct. @stleary , let me make a test case just to confirm. it's possible that those returns should be continuess instead

@stleary
Copy link
Owner

stleary commented Nov 13, 2017

Issue resolved.

@stleary stleary closed this as completed Nov 13, 2017
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