mirror of
https://github.com/stleary/JSON-java.git
synced 2026-01-24 00:03:17 -05:00
Merge pull request #907 from hexetia/fix-901
Fix a bug when calling JSONArray.addAll() with Collection as Object
This commit is contained in:
@@ -259,6 +259,11 @@ public class JSONArrayTest {
|
||||
jsonArray.length(),
|
||||
len);
|
||||
|
||||
// collection as object
|
||||
@SuppressWarnings("RedundantCast")
|
||||
Object myListAsObject = (Object) myList;
|
||||
jsonArray.putAll(myListAsObject);
|
||||
|
||||
for (int i = 0; i < myList.size(); i++) {
|
||||
assertEquals("collection elements should be equal",
|
||||
myList.get(i),
|
||||
|
||||
Reference in New Issue
Block a user