mirror of
https://github.com/ethauvin/JSON-java.git
synced 2025-06-17 07:50:52 -07:00
Java 1.6 compatibility.
This commit is contained in:
parent
ba2585fe6c
commit
60349ece54
2 changed files with 8 additions and 4 deletions
|
@ -76,7 +76,7 @@ import java.util.Map;
|
||||||
* </ul>
|
* </ul>
|
||||||
*
|
*
|
||||||
* @author JSON.org
|
* @author JSON.org
|
||||||
* @version 2015-10-29
|
* @version 2016-02-08
|
||||||
*/
|
*/
|
||||||
public class JSONArray implements Iterable<Object> {
|
public class JSONArray implements Iterable<Object> {
|
||||||
|
|
||||||
|
@ -593,7 +593,9 @@ public class JSONArray implements Iterable<Object> {
|
||||||
return myE;
|
return myE;
|
||||||
}
|
}
|
||||||
return Enum.valueOf(clazz, val.toString());
|
return Enum.valueOf(clazz, val.toString());
|
||||||
} catch (IllegalArgumentException | NullPointerException e) {
|
} catch (IllegalArgumentException e) {
|
||||||
|
return defaultValue;
|
||||||
|
} catch (NullPointerException e) {
|
||||||
return defaultValue;
|
return defaultValue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -93,7 +93,7 @@ import java.util.Set;
|
||||||
* </ul>
|
* </ul>
|
||||||
*
|
*
|
||||||
* @author JSON.org
|
* @author JSON.org
|
||||||
* @version 2015-01-30
|
* @version 2016-02-08
|
||||||
*/
|
*/
|
||||||
public class JSONObject {
|
public class JSONObject {
|
||||||
/**
|
/**
|
||||||
|
@ -901,7 +901,9 @@ public class JSONObject {
|
||||||
return myE;
|
return myE;
|
||||||
}
|
}
|
||||||
return Enum.valueOf(clazz, val.toString());
|
return Enum.valueOf(clazz, val.toString());
|
||||||
} catch (IllegalArgumentException | NullPointerException e) {
|
} catch (IllegalArgumentException e) {
|
||||||
|
return defaultValue;
|
||||||
|
} catch (NullPointerException e) {
|
||||||
return defaultValue;
|
return defaultValue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue