Updating to work with java 1.6

This commit is contained in:
sk02241994
2025-09-09 17:01:30 +10:00
parent 7d28955216
commit ebc13d6685
2 changed files with 16 additions and 4 deletions

View File

@@ -40,14 +40,14 @@ public class JSONBuilder {
* <li>{@code String.class} -> Identity function</li> * <li>{@code String.class} -> Identity function</li>
* </ul> * </ul>
*/ */
private static final Map<Class<?>, TypeConverter<?>> classMapping = new HashMap<>(); private static final Map<Class<?>, TypeConverter<?>> classMapping = new HashMap<Class<?>, TypeConverter<?>>();
/** /**
* A mapping from collection interface types to suppliers that produce * A mapping from collection interface types to suppliers that produce
* instances of concrete collection implementations. * instances of concrete collection implementations.
* *
*/ */
private static final Map<Class<?>, InstanceCreator<?>> collectionMapping = new HashMap<>(); private static final Map<Class<?>, InstanceCreator<?>> collectionMapping = new HashMap<Class<?>, InstanceCreator<?>>();
// Static initializer block to populate default mappings // Static initializer block to populate default mappings
static { static {

View File

@@ -3283,7 +3283,13 @@ public class JSONObject {
} }
} }
return obj; return obj;
} catch (NoSuchMethodException | InstantiationException | IllegalAccessException | InvocationTargetException e) { } catch (NoSuchMethodException e) {
throw new JSONException(e);
} catch (InstantiationException e) {
throw new JSONException(e);
} catch (IllegalAccessException e) {
throw new JSONException(e);
} catch (InvocationTargetException e) {
throw new JSONException(e); throw new JSONException(e);
} }
} }
@@ -3331,7 +3337,13 @@ public class JSONObject {
} }
} }
return collection; return collection;
} catch (NoSuchMethodException | InstantiationException | IllegalAccessException | InvocationTargetException e) { } catch (NoSuchMethodException e) {
throw new JSONException(e);
} catch (InstantiationException e) {
throw new JSONException(e);
} catch (IllegalAccessException e) {
throw new JSONException(e);
} catch (InvocationTargetException e) {
throw new JSONException(e); throw new JSONException(e);
} }
} }