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:33:38 +0000 (14:33 -0500)
commitd262e2892203dc74fcd1abc69a9ae7458566b18a
tree559c5948765c897a57856686a37acd81b47930eb
parent2883586dd2c6852ce817dcf117d263283e14c9e1
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