Merge pull request #683 from spaffrath/Issue_682_JSONString_similarity

Issue 682 JSONString similarity
This commit is contained in:
Sean Leary
2022-08-26 20:57:22 -05:00
committed by GitHub
4 changed files with 54 additions and 0 deletions

View File

@@ -2146,6 +2146,10 @@ public class JSONObject {
if (!isNumberSimilar((Number)valueThis, (Number)valueOther)) {
return false;
}
} else if (valueThis instanceof JSONString && valueOther instanceof JSONString) {
if (!((JSONString) valueThis).toJSONString().equals(((JSONString) valueOther).toJSONString())) {
return false;
}
} else if (!valueThis.equals(valueOther)) {
return false;
}