Java config parsing, in particular getString and getInt, no longer fail
when encountering a number value in the internl JSON->Map object.
Java does not allow the following cast:
String s = (String) someNumber;
Instead, rely on the object's toString() which is safe and guaranteed
to exist.
Signed-off-by: Bill Erickson <berick@esilibrary.com>
Signed-off-by: Jason Stephenson <jstephenson@mvlc.org>
Signed-off-by: Dan Scott <dscott@laurentian.ca>
*/
public String getString(String path) throws ConfigException {
try {
- return (String) get(path);
+ return get(path).toString();
} catch(Exception e) {
throw new
ConfigException("No config string found at " + path);