1
0
Fork 0
mirror of https://github.com/ethauvin/JSON-java.git synced 2025-06-17 07:50:52 -07:00

Merge pull request #195 from publishing-systems/master

Java 1.6 compatibility.
This commit is contained in:
Sean Leary 2016-02-12 18:10:13 -06:00
commit 07a0f60b6e
2 changed files with 8 additions and 4 deletions

View file

@ -76,7 +76,7 @@ import java.util.Map;
* </ul>
*
* @author JSON.org
* @version 2015-10-29
* @version 2016-02-08
*/
public class JSONArray implements Iterable<Object> {
@ -593,7 +593,9 @@ public class JSONArray implements Iterable<Object> {
return myE;
}
return Enum.valueOf(clazz, val.toString());
} catch (IllegalArgumentException | NullPointerException e) {
} catch (IllegalArgumentException e) {
return defaultValue;
} catch (NullPointerException e) {
return defaultValue;
}
}

View file

@ -93,7 +93,7 @@ import java.util.Set;
* </ul>
*
* @author JSON.org
* @version 2015-01-30
* @version 2016-02-08
*/
public class JSONObject {
/**
@ -901,7 +901,9 @@ public class JSONObject {
return myE;
}
return Enum.valueOf(clazz, val.toString());
} catch (IllegalArgumentException | NullPointerException e) {
} catch (IllegalArgumentException e) {
return defaultValue;
} catch (NullPointerException e) {
return defaultValue;
}
}