From: Dave Cramer Date: Tue, 5 Mar 2002 03:46:03 +0000 (+0000) Subject: Doug Fields patch to prevent exception being thrown on zero length arrays X-Git-Tag: REL9_0_0~18255 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=17b6baf17dc5ea72f4739e66e1bec77d413155a9;p=pg-rex%2Fsyncrep.git Doug Fields patch to prevent exception being thrown on zero length arrays --- diff --git a/src/interfaces/jdbc/org/postgresql/jdbc2/Array.java b/src/interfaces/jdbc/org/postgresql/jdbc2/Array.java index 14948e5b4b..f68106ee7b 100644 --- a/src/interfaces/jdbc/org/postgresql/jdbc2/Array.java +++ b/src/interfaces/jdbc/org/postgresql/jdbc2/Array.java @@ -74,7 +74,13 @@ public class Array implements java.sql.Array Object retVal = null; ArrayList array = new ArrayList(); - if ( rawString != null ) + + /* Check if the String is also not an empty array + * otherwise there will be an exception thrown below + * in the ResultSet.toX with an empty string. + * -- Doug Fields Feb 20, 2002 */ + + if ( rawString != null && !rawString.equals("{}") ) { char[] chars = rawString.toCharArray(); StringBuffer sbuf = new StringBuffer();