Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 07a0f60

Browse filesBrowse files
committed
Merge pull request stleary#195 from publishing-systems/master
Java 1.6 compatibility.
2 parents ba2585f + 60349ec commit 07a0f60
Copy full SHA for 07a0f60

File tree

Expand file treeCollapse file tree

2 files changed

+8
-4
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

2 files changed

+8
-4
lines changed
Open diff view settings
Collapse file

‎JSONArray.java‎

Copy file name to clipboardExpand all lines: JSONArray.java
+4-2Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ of this software and associated documentation files (the "Software"), to deal
7676
* </ul>
7777
*
7878
* @author JSON.org
79-
* @version 2015-10-29
79+
* @version 2016-02-08
8080
*/
8181
public class JSONArray implements Iterable<Object> {
8282

@@ -593,7 +593,9 @@ public <E extends Enum<E>> E optEnum(Class<E> clazz, int index, E defaultValue)
593593
return myE;
594594
}
595595
return Enum.valueOf(clazz, val.toString());
596-
} catch (IllegalArgumentException | NullPointerException e) {
596+
} catch (IllegalArgumentException e) {
597+
return defaultValue;
598+
} catch (NullPointerException e) {
597599
return defaultValue;
598600
}
599601
}
Collapse file

‎JSONObject.java‎

Copy file name to clipboardExpand all lines: JSONObject.java
+4-2Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ of this software and associated documentation files (the "Software"), to deal
9393
* </ul>
9494
*
9595
* @author JSON.org
96-
* @version 2015-01-30
96+
* @version 2016-02-08
9797
*/
9898
public class JSONObject {
9999
/**
@@ -901,7 +901,9 @@ public <E extends Enum<E>> E optEnum(Class<E> clazz, String key, E defaultValue)
901901
return myE;
902902
}
903903
return Enum.valueOf(clazz, val.toString());
904-
} catch (IllegalArgumentException | NullPointerException e) {
904+
} catch (IllegalArgumentException e) {
905+
return defaultValue;
906+
} catch (NullPointerException e) {
905907
return defaultValue;
906908
}
907909
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.