Skip to content

Commit 4fef56c

Browse files
author
Robert Bittle
committed
Allow duplicate keys if they are equal
1 parent 5c59e19 commit 4fef56c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/org/json/JSONObject.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1309,7 +1309,7 @@ public JSONObject putOnce(String key, Object value) throws JSONException
13091309
{
13101310
if (key != null && value != null)
13111311
{
1312-
if (opt(key) != null)
1312+
if (opt(key) != null && !opt(key).equals(value))
13131313
{
13141314
throw new JSONException("Duplicate key \"" + key + "\"");
13151315
}

0 commit comments

Comments
 (0)