[OpenSRF-GIT] OpenSRF branch master updated. d262e2892203dc74fcd1abc69a9ae7458566b18a

Evergreen Git git at git.evergreen-ils.org
Fri Dec 14 14:33:54 EST 2012


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "OpenSRF".

The branch, master has been updated
       via  d262e2892203dc74fcd1abc69a9ae7458566b18a (commit)
      from  2883586dd2c6852ce817dcf117d263283e14c9e1 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit d262e2892203dc74fcd1abc69a9ae7458566b18a
Author: Bill Erickson <berick at esilibrary.com>
Date:   Thu Nov 1 09:41:52 2012 -0400

    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 at esilibrary.com>
    Signed-off-by: Jason Stephenson <jstephenson at mvlc.org>
    Signed-off-by: Dan Scott <dscott at laurentian.ca>

diff --git a/src/java/org/opensrf/util/Config.java b/src/java/org/opensrf/util/Config.java
index ddac9c0..526d863 100644
--- a/src/java/org/opensrf/util/Config.java
+++ b/src/java/org/opensrf/util/Config.java
@@ -78,7 +78,7 @@ public class Config {
      */
     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);

-----------------------------------------------------------------------

Summary of changes:
 src/java/org/opensrf/util/Config.java |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)


hooks/post-receive
-- 
OpenSRF


More information about the opensrf-commits mailing list