Updating to work with java 1.6

This commit is contained in:
sk02241994
2025-10-23 17:33:37 +11:00
parent 8ccf5d7525
commit f92f281620

View File

@@ -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());
} }