Skip to content

Commit 2155516

Browse files
committed
Updating to work with java 1.6
1 parent 8743fe9 commit 2155516

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/main/java/org/json/JSONObject.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3500,7 +3500,11 @@ else if (!rawType.isPrimitive() && !rawType.isEnum() && value instanceof JSONObj
35003500
*/
35013501
private Map<?, ?> convertToMap(JSONObject jsonMap, Type keyType, Type valueType, Class<?> mapType) throws JSONException {
35023502
try {
3503-
InstanceCreator<?> creator = collectionMapping.getOrDefault(mapType, () -> new HashMap<>());
3503+
InstanceCreator<?> creator = collectionMapping.getOrDefault(mapType, new InstanceCreator<List>() {
3504+
public List create() {
3505+
return new HashMap();
3506+
}
3507+
});
35043508
@SuppressWarnings("unchecked")
35053509
Map<Object, Object> createdMap = (Map<Object, Object>) creator.create();
35063510

0 commit comments

Comments
 (0)