Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions JSONArray.java
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ of this software and associated documentation files (the "Software"), to deal
* </ul>
*
* @author JSON.org
* @version 2015-10-29
* @version 2016-02-08
*/
public class JSONArray implements Iterable<Object> {

Expand Down Expand Up @@ -593,7 +593,9 @@ public <E extends Enum<E>> E optEnum(Class<E> clazz, int index, E defaultValue)
return myE;
}
return Enum.valueOf(clazz, val.toString());
} catch (IllegalArgumentException | NullPointerException e) {
} catch (IllegalArgumentException e) {
return defaultValue;
} catch (NullPointerException e) {
return defaultValue;
}
}
Expand Down
6 changes: 4 additions & 2 deletions JSONObject.java
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ of this software and associated documentation files (the "Software"), to deal
* </ul>
*
* @author JSON.org
* @version 2015-01-30
* @version 2016-02-08
*/
public class JSONObject {
/**
Expand Down Expand Up @@ -901,7 +901,9 @@ public <E extends Enum<E>> E optEnum(Class<E> clazz, String key, E defaultValue)
return myE;
}
return Enum.valueOf(clazz, val.toString());
} catch (IllegalArgumentException | NullPointerException e) {
} catch (IllegalArgumentException e) {
return defaultValue;
} catch (NullPointerException e) {
return defaultValue;
}
}
Expand Down