We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8a1b5a1 commit 2257a3aCopy full SHA for 2257a3a
1 file changed
JSONObject.java
@@ -1681,17 +1681,17 @@ public static Object wrap(Object object) {
1681
return object;
1682
}
1683
1684
+ if (object instanceof Map) {
1685
+ Map<?, ?> map = (Map<?, ?>) object;
1686
+ return new JSONObject(map);
1687
+ }
1688
if (object instanceof Collection) {
1689
Collection<?> coll = (Collection<?>) object;
1690
return new JSONArray(coll);
1691
1692
if (object.getClass().isArray()) {
1693
return new JSONArray(object);
1694
- if (object instanceof Map) {
- Map<?, ?> map = (Map<?, ?>) object;
- return new JSONObject(map);
- }
1695
Package objectPackage = object.getClass().getPackage();
1696
String objectPackageName = objectPackage != null ? objectPackage
1697
.getName() : "";
0 commit comments