mirror of
https://github.com/stleary/JSON-java.git
synced 2026-01-24 00:03:17 -05:00
Updating to work with java 1.6
This commit is contained in:
@@ -3450,9 +3450,9 @@ public class JSONObject {
|
|||||||
*/
|
*/
|
||||||
private Collection getCollection(Class<?> collectionType) throws JSONException {
|
private Collection getCollection(Class<?> collectionType) throws JSONException {
|
||||||
if (collectionType == List.class || collectionType == ArrayList.class) {
|
if (collectionType == List.class || collectionType == ArrayList.class) {
|
||||||
return new ArrayList<>();
|
return new ArrayList();
|
||||||
} else if (collectionType == Set.class || collectionType == HashSet.class) {
|
} else if (collectionType == Set.class || collectionType == HashSet.class) {
|
||||||
return new HashSet<>();
|
return new HashSet();
|
||||||
} else {
|
} else {
|
||||||
throw new JSONException("Unsupported Collection type: " + collectionType.getName());
|
throw new JSONException("Unsupported Collection type: " + collectionType.getName());
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user