]> git.evergreen-ils.org Git - OpenSRF.git/commit
Safer casting in java config parsing
authorBill Erickson <berick@esilibrary.com>
Thu, 1 Nov 2012 13:41:52 +0000 (09:41 -0400)
committerDan Scott <dscott@laurentian.ca>
Fri, 14 Dec 2012 19:34:09 +0000 (14:34 -0500)
commitcd1280c3e6a8981255762ad01c7dac4cf4c76da5
tree8d3a4729946b0e1c1fbe84a3180457a2ad553ebc
parentf38ce0fc261da8a7da6f25afb29285d23b9c4fae
Safer casting in java config parsing

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>
src/java/org/opensrf/util/Config.java