@@ -1206,7 +1206,7 @@ public JSONObject put(String key, boolean value) throws JSONException {
1206
1206
* @return this.
1207
1207
* @throws JSONException
1208
1208
*/
1209
- public JSONObject put (String key , Collection <Object > value ) throws JSONException {
1209
+ public JSONObject put (String key , Collection <? > value ) throws JSONException {
1210
1210
this .put (key , new JSONArray (value ));
1211
1211
return this ;
1212
1212
}
@@ -1270,7 +1270,7 @@ public JSONObject put(String key, long value) throws JSONException {
1270
1270
* @return this.
1271
1271
* @throws JSONException
1272
1272
*/
1273
- public JSONObject put (String key , Map <String , Object > value ) throws JSONException {
1273
+ public JSONObject put (String key , Map <String , ? > value ) throws JSONException {
1274
1274
this .put (key , new JSONObject (value ));
1275
1275
return this ;
1276
1276
}
@@ -1666,12 +1666,12 @@ public static String valueToString(Object value) throws JSONException {
1666
1666
}
1667
1667
if (value instanceof Map ) {
1668
1668
@ SuppressWarnings ("unchecked" )
1669
- Map <String , Object > map = (Map <String , Object >) value ;
1669
+ Map <String , ? > map = (Map <String , ? >) value ;
1670
1670
return new JSONObject (map ).toString ();
1671
1671
}
1672
1672
if (value instanceof Collection ) {
1673
1673
@ SuppressWarnings ("unchecked" )
1674
- Collection <Object > coll = (Collection <Object >) value ;
1674
+ Collection <? > coll = (Collection <? >) value ;
1675
1675
return new JSONArray (coll ).toString ();
1676
1676
}
1677
1677
if (value .getClass ().isArray ()) {
@@ -1710,15 +1710,15 @@ public static Object wrap(Object object) {
1710
1710
1711
1711
if (object instanceof Collection ) {
1712
1712
@ SuppressWarnings ("unchecked" )
1713
- Collection <Object > coll = (Collection <Object >) object ;
1713
+ Collection <? > coll = (Collection <? >) object ;
1714
1714
return new JSONArray (coll );
1715
1715
}
1716
1716
if (object .getClass ().isArray ()) {
1717
1717
return new JSONArray (object );
1718
1718
}
1719
1719
if (object instanceof Map ) {
1720
1720
@ SuppressWarnings ("unchecked" )
1721
- Map <String , Object > map = (Map <String , Object >) object ;
1721
+ Map <String , ? > map = (Map <String , ? >) object ;
1722
1722
return new JSONObject (map );
1723
1723
}
1724
1724
Package objectPackage = object .getClass ().getPackage ();
@@ -1758,13 +1758,12 @@ static final Writer writeValue(Writer writer, Object value,
1758
1758
((JSONArray ) value ).write (writer , indentFactor , indent );
1759
1759
} else if (value instanceof Map ) {
1760
1760
@ SuppressWarnings ("unchecked" )
1761
- Map <String , Object > map = (Map <String , Object >) value ;
1761
+ Map <String , ? > map = (Map <String , ? >) value ;
1762
1762
new JSONObject (map ).write (writer , indentFactor , indent );
1763
1763
} else if (value instanceof Collection ) {
1764
1764
@ SuppressWarnings ("unchecked" )
1765
- Collection <Object > coll = (Collection <Object >) value ;
1766
- new JSONArray (coll ).write (writer , indentFactor ,
1767
- indent );
1765
+ Collection <?> coll = (Collection <?>) value ;
1766
+ new JSONArray (coll ).write (writer , indentFactor , indent );
1768
1767
} else if (value .getClass ().isArray ()) {
1769
1768
new JSONArray (value ).write (writer , indentFactor , indent );
1770
1769
} else if (value instanceof Number ) {
0 commit comments