You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The 'a' value is set by put(double) and is not exactly equal to 1.1.
The 'b' value is initialized by parsing a string in the JSONObject constructor. Due to recent changes, it is parsed into a BigDecimal, and is exactly equal to 1.1.
I think this needs to be fixed. If anyone has preferences or opinions on how to fix it, please post here. Otherwise, I will come up with a solution in a few days.
After upgrading from 20200518 to 20210307 some of our tests that are using JSONObject::similar started to fail.
This case reproduces the problem:
This creates two JSONObjects whose value is just
{"a":1.1}
.The output of this snippet on 20200518 is
but on version 20210307 the similar call suddenly returns false, even though the string representations of the objects are the same:
The text was updated successfully, but these errors were encountered: